()
| 73 | } |
| 74 | |
| 75 | render() { |
| 76 | return ( |
| 77 | <div |
| 78 | role="dialog" |
| 79 | class="border text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 w-[340px] rounded-2xl bg-white p-6 dark:bg-zinc-950" |
| 80 | tabindex="-1" |
| 81 | > |
| 82 | <div class="theme-zinc w-full flex flex-col space-y-4 md:space-y-6" style="--radius: 0.5rem;"> |
| 83 | <div class="flex items-start pt-4 md:pt-0"> |
| 84 | <div class="space-y-1 pr-2"> |
| 85 | <div class="font-semibold leading-none tracking-tight text-lg dark:text-foreground">自定义</div> |
| 86 | <div class="text-muted-foreground text-zinc-600 dark:text-foreground">为你的模板选择一个颜色和样式。</div> |
| 87 | </div> |
| 88 | </div> |
| 89 | <div class="flex flex-1 flex-col space-y-4 md:space-y-6"> |
| 90 | <div class="space-y-1.5"> |
| 91 | <label class="font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-foreground"> |
| 92 | 颜色 |
| 93 | </label> |
| 94 | <div class="grid grid-cols-3 gap-2"> |
| 95 | {this.colors.map((item) => { |
| 96 | return ( |
| 97 | <button |
| 98 | onClick={this.onColorClick} |
| 99 | class="inline-flex items-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-8 rounded-md px-3 text-xs justify-start dark:text-foreground" |
| 100 | data-color={item.color} |
| 101 | style={`--theme-primary: ${item.color};`} |
| 102 | > |
| 103 | <span class="mr-0.5 flex h-5 w-5 shrink-0 -translate-x-1 items-center justify-center rounded-full bg-[--theme-primary]"> |
| 104 | {this.state.selectedColor === item.color && ( |
| 105 | <svg |
| 106 | width="15" |
| 107 | height="15" |
| 108 | viewBox="0 0 15 15" |
| 109 | fill="none" |
| 110 | xmlns="http://www.w3.org/2000/svg" |
| 111 | class="h-4 w-4 text-white" |
| 112 | > |
| 113 | <path |
| 114 | d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" |
| 115 | fill="currentColor" |
| 116 | fill-rule="evenodd" |
| 117 | clip-rule="evenodd" |
| 118 | ></path> |
| 119 | </svg> |
| 120 | )} |
| 121 | </span> |
| 122 | {item.name} |
| 123 | </button> |
| 124 | ) |
| 125 | })} |
| 126 | </div> |
| 127 | </div> |
| 128 | {/* <div class="space-y-1.5"> |
| 129 | <label class="font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70">圆角</label> |
| 130 | <div class="grid grid-cols-5 gap-2"> |
| 131 | <button class="inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground h-8 rounded-md px-3 text-xs"> |
| 132 | 0 |
nothing calls this directly
no test coverage detected