@fibrae/semi-foundation 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/dist/anchor/foundation.d.ts +1 -4
  2. package/dist/anchor/foundation.js +21 -22
  3. package/dist/audio-player/foundation.d.ts +10 -13
  4. package/dist/audio-player/foundation.js +19 -20
  5. package/dist/auto-complete/foundation.d.ts +12 -14
  6. package/dist/auto-complete/foundation.js +51 -52
  7. package/dist/avatar/foundation.d.ts +5 -6
  8. package/dist/avatar/foundation.js +16 -16
  9. package/dist/avatar/variables.scss +0 -1
  10. package/dist/backtop/foundation.d.ts +2 -5
  11. package/dist/backtop/foundation.js +7 -8
  12. package/dist/banner/foundation.d.ts +1 -1
  13. package/dist/banner/foundation.js +4 -4
  14. package/dist/base/auto-close-foundation.d.ts +8 -9
  15. package/dist/base/auto-close-foundation.js +15 -15
  16. package/dist/base/foundation.d.ts +4 -4
  17. package/dist/base/foundation.js +12 -11
  18. package/dist/base/list-store.d.ts +0 -1
  19. package/dist/breadcrumb/foundation.d.ts +5 -5
  20. package/dist/breadcrumb/foundation.js +9 -10
  21. package/dist/breadcrumb/item-foundation.d.ts +3 -3
  22. package/dist/breadcrumb/item-foundation.js +6 -6
  23. package/dist/calendar/event-util.d.ts +0 -10
  24. package/dist/calendar/event-util.js +1 -11
  25. package/dist/calendar/foundation.d.ts +1 -6
  26. package/dist/calendar/foundation.js +5 -9
  27. package/dist/calendar/month-foundation.d.ts +2 -3
  28. package/dist/calendar/month-foundation.js +6 -7
  29. package/dist/carousel/foundation.d.ts +17 -19
  30. package/dist/carousel/foundation.js +51 -51
  31. package/dist/cascader/foundation.d.ts +36 -32
  32. package/dist/cascader/foundation.js +145 -132
  33. package/dist/cascader/util.d.ts +1 -8
  34. package/dist/cascader/util.js +1 -8
  35. package/dist/checkbox/checkbox-foundation.d.ts +3 -7
  36. package/dist/checkbox/checkbox-foundation.js +15 -17
  37. package/dist/checkbox/checkbox-group-foundation.d.ts +2 -3
  38. package/dist/checkbox/checkbox-group-foundation.js +8 -8
  39. package/dist/code-highlight/index.d.ts +1 -2
  40. package/dist/code-highlight/index.js +3 -3
  41. package/dist/collapse/foundation.d.ts +2 -2
  42. package/dist/collapse/foundation.js +7 -7
  43. package/dist/collapsible/foundation.d.ts +3 -3
  44. package/dist/collapsible/foundation.js +8 -8
  45. package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
  46. package/dist/color-picker/alpha-slider-foundation.js +10 -10
  47. package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
  48. package/dist/color-picker/color-choose-area-foundation.js +14 -14
  49. package/dist/color-picker/color-picker.scss +0 -2
  50. package/dist/color-picker/color-slider-foundation.d.ts +2 -4
  51. package/dist/color-picker/color-slider-foundation.js +10 -10
  52. package/dist/color-picker/data-part-foundation.d.ts +5 -5
  53. package/dist/color-picker/data-part-foundation.js +11 -11
  54. package/dist/color-picker/foundation.d.ts +4 -4
  55. package/dist/color-picker/foundation.js +10 -10
  56. package/dist/color-picker/interface.d.ts +0 -1
  57. package/dist/config-provider/breakpoint-observer.d.ts +3 -3
  58. package/dist/config-provider/breakpoint-observer.js +6 -6
  59. package/dist/config-provider/responsive-types.d.ts +0 -16
  60. package/dist/cropper/foundation.d.ts +15 -16
  61. package/dist/cropper/foundation.js +26 -24
  62. package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
  63. package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
  64. package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
  65. package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
  66. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
  67. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
  68. package/dist/date-picker/_utils/parser.d.ts +0 -3
  69. package/dist/date-picker/_utils/parser.js +0 -7
  70. package/dist/date-picker/_utils/picker-type.d.ts +1 -3
  71. package/dist/date-picker/_utils/picker-type.js +0 -2
  72. package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
  73. package/dist/date-picker/_utils/to-callback-args.js +0 -1
  74. package/dist/date-picker/date-picker.scss +0 -3
  75. package/dist/date-picker/foundation.d.ts +39 -58
  76. package/dist/date-picker/foundation.js +126 -153
  77. package/dist/date-picker/input-foundation.d.ts +10 -16
  78. package/dist/date-picker/input-foundation.js +28 -30
  79. package/dist/date-picker/month-foundation.d.ts +0 -3
  80. package/dist/date-picker/month-foundation.js +0 -2
  81. package/dist/date-picker/months-grid-foundation.d.ts +17 -26
  82. package/dist/date-picker/months-grid-foundation.js +65 -75
  83. package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
  84. package/dist/date-picker/year-and-month-foundation.js +11 -11
  85. package/dist/drag-move/foundation.d.ts +2 -3
  86. package/dist/drag-move/foundation.js +15 -13
  87. package/dist/dropdown/foundation.d.ts +8 -7
  88. package/dist/dropdown/foundation.js +32 -28
  89. package/dist/dropdown/menu-foundation.d.ts +1 -2
  90. package/dist/dropdown/menu-foundation.js +11 -11
  91. package/dist/feedback/foundation.d.ts +9 -10
  92. package/dist/feedback/foundation.js +33 -33
  93. package/dist/feedback/variables.scss +1 -5
  94. package/dist/float-button/float-button.css +0 -1
  95. package/dist/float-button/float-button.scss +0 -2
  96. package/dist/form/form-api-proxy.d.ts +8 -7
  97. package/dist/form/form-api-proxy.js +25 -25
  98. package/dist/form/form.scss +0 -12
  99. package/dist/form/foundation.d.ts +5 -5
  100. package/dist/form/foundation.js +60 -76
  101. package/dist/form/interface.d.ts +2 -15
  102. package/dist/form/utils.d.ts +0 -8
  103. package/dist/form/utils.js +0 -7
  104. package/dist/form/variables.scss +1 -4
  105. package/dist/grid/variables.scss +0 -10
  106. package/dist/highlight/foundation.d.ts +0 -2
  107. package/dist/highlight/foundation.js +1 -3
  108. package/dist/hot-keys/foundation.d.ts +2 -3
  109. package/dist/hot-keys/foundation.js +5 -5
  110. package/dist/image/image-foundation.d.ts +4 -6
  111. package/dist/image/image-foundation.js +10 -10
  112. package/dist/image/preview-footer-foundation.d.ts +3 -4
  113. package/dist/image/preview-footer-foundation.js +10 -10
  114. package/dist/image/preview-foundation.d.ts +0 -3
  115. package/dist/image/preview-foundation.js +7 -6
  116. package/dist/image/preview-image-foundation.d.ts +6 -9
  117. package/dist/image/preview-image-foundation.js +14 -14
  118. package/dist/image/preview-inner-foundation.d.ts +9 -10
  119. package/dist/image/preview-inner-foundation.js +38 -38
  120. package/dist/input/foundation.d.ts +10 -11
  121. package/dist/input/foundation.js +47 -49
  122. package/dist/input/text-entry-foundation.d.ts +3 -5
  123. package/dist/input/text-entry-foundation.js +14 -15
  124. package/dist/input/textarea-foundation.d.ts +7 -8
  125. package/dist/input/textarea-foundation.js +36 -36
  126. package/dist/input-number/caret.d.ts +0 -1
  127. package/dist/input-number/caret.js +0 -1
  128. package/dist/input-number/foundation.d.ts +16 -19
  129. package/dist/input-number/foundation.js +54 -58
  130. package/dist/json-viewer/foundation.d.ts +8 -10
  131. package/dist/json-viewer/foundation.js +23 -24
  132. package/dist/locale/interface.d.ts +0 -3
  133. package/dist/lottie/foundation.d.ts +1 -1
  134. package/dist/lottie/foundation.js +4 -4
  135. package/dist/markdown-render/foundation.d.ts +2 -7
  136. package/dist/markdown-render/foundation.js +5 -9
  137. package/dist/modal/modal-content-foundation.d.ts +7 -7
  138. package/dist/modal/modal-content-foundation.js +20 -20
  139. package/dist/modal/modal-foundation.d.ts +6 -6
  140. package/dist/modal/modal-foundation.js +24 -24
  141. package/dist/navigation/foundation.d.ts +1 -8
  142. package/dist/navigation/foundation.js +14 -20
  143. package/dist/navigation/item-foundation.d.ts +1 -1
  144. package/dist/navigation/item-foundation.js +8 -8
  145. package/dist/navigation/sub-nav-foundation.d.ts +3 -4
  146. package/dist/navigation/sub-nav-foundation.js +17 -17
  147. package/dist/notification/notification-list-foundation.d.ts +7 -8
  148. package/dist/notification/notification-list-foundation.js +12 -13
  149. package/dist/notification/variables.scss +0 -1
  150. package/dist/overflow-list/foundation.d.ts +4 -6
  151. package/dist/overflow-list/foundation.js +18 -19
  152. package/dist/pagination/foundation.d.ts +8 -10
  153. package/dist/pagination/foundation.js +28 -28
  154. package/dist/pincode/foundation.d.ts +6 -9
  155. package/dist/pincode/foundation.js +23 -26
  156. package/dist/popconfirm/popconfirm-foundation.d.ts +7 -9
  157. package/dist/popconfirm/popconfirm-foundation.js +26 -26
  158. package/dist/progress/generates.d.ts +1 -4
  159. package/dist/progress/generates.js +1 -4
  160. package/dist/progress/utils.d.ts +1 -1
  161. package/dist/progress/utils.js +1 -1
  162. package/dist/radio/radio-foundation.d.ts +5 -9
  163. package/dist/radio/radio-foundation.js +15 -16
  164. package/dist/radio/radio-group-foundation.d.ts +2 -3
  165. package/dist/radio/radio-group-foundation.js +9 -9
  166. package/dist/rating/foundation.d.ts +10 -15
  167. package/dist/rating/foundation.js +35 -38
  168. package/dist/resizable/group/index.d.ts +6 -10
  169. package/dist/resizable/group/index.js +40 -44
  170. package/dist/resizable/resizable.scss +0 -1
  171. package/dist/resizable/single/index.d.ts +3 -7
  172. package/dist/resizable/single/index.js +10 -13
  173. package/dist/scroll-list/item-foundation.d.ts +7 -9
  174. package/dist/scroll-list/item-foundation.js +35 -36
  175. package/dist/scroll-list/variables.scss +1 -6
  176. package/dist/select/foundation.d.ts +42 -57
  177. package/dist/select/foundation.js +214 -279
  178. package/dist/select/option-foundation.d.ts +23 -28
  179. package/dist/select/option-foundation.js +10 -19
  180. package/dist/select/variables.scss +1 -8
  181. package/dist/side-sheet/side-sheet-foundation.d.ts +7 -12
  182. package/dist/side-sheet/side-sheet-foundation.js +23 -27
  183. package/dist/side-sheet/variables.scss +1 -3
  184. package/dist/slider/foundation.d.ts +17 -28
  185. package/dist/slider/foundation.js +47 -59
  186. package/dist/slider/variables.scss +1 -5
  187. package/dist/sortable/accessibility.d.ts +1 -1
  188. package/dist/sortable/accessibility.js +2 -2
  189. package/dist/spin/foundation.d.ts +2 -4
  190. package/dist/spin/foundation.js +6 -7
  191. package/dist/spin/variables.scss +1 -3
  192. package/dist/steps/utils.d.ts +1 -1
  193. package/dist/switch/foundation.d.ts +2 -3
  194. package/dist/switch/foundation.js +7 -7
  195. package/dist/switch/switch.scss +1 -1
  196. package/dist/switch/variables.scss +1 -5
  197. package/dist/table/foundation.d.ts +24 -33
  198. package/dist/table/foundation.js +144 -108
  199. package/dist/table/table.scss +0 -1
  200. package/dist/table/utils.d.ts +2 -10
  201. package/dist/table/utils.js +0 -13
  202. package/dist/table/variables.scss +1 -5
  203. package/dist/tabs/foundation.d.ts +5 -14
  204. package/dist/tabs/foundation.js +17 -21
  205. package/dist/tabs/tabs.scss +1 -1
  206. package/dist/tag/focus.js +0 -1
  207. package/dist/tag-input/foundation.d.ts +11 -13
  208. package/dist/tag-input/foundation.js +52 -53
  209. package/dist/tag-input/tag-input.scss +0 -1
  210. package/dist/tag-input/utils/tag-focus.d.ts +0 -1
  211. package/dist/tag-input/utils/tag-focus.js +0 -1
  212. package/dist/time-picker/combox-foundation.d.ts +3 -11
  213. package/dist/time-picker/combox-foundation.js +3 -10
  214. package/dist/time-picker/foundation.d.ts +13 -23
  215. package/dist/time-picker/foundation.js +39 -48
  216. package/dist/time-picker/input-foundation.d.ts +4 -4
  217. package/dist/time-picker/input-foundation.js +13 -13
  218. package/dist/time-picker/utils/index.d.ts +0 -11
  219. package/dist/time-picker/utils/index.js +0 -11
  220. package/dist/toast/toast-list-foundation.d.ts +7 -7
  221. package/dist/toast/toast-list-foundation.js +14 -14
  222. package/dist/tooltip/adjust-position.d.ts +1 -2
  223. package/dist/tooltip/constants.d.ts +0 -3
  224. package/dist/tooltip/constants.js +0 -3
  225. package/dist/tooltip/foundation.d.ts +9 -12
  226. package/dist/tooltip/foundation.js +67 -63
  227. package/dist/tooltip/position.scss +0 -1
  228. package/dist/transfer/foundation.d.ts +22 -13
  229. package/dist/transfer/foundation.js +38 -24
  230. package/dist/tree/foundation.d.ts +14 -16
  231. package/dist/tree/foundation.js +61 -62
  232. package/dist/tree/shared.d.ts +2 -4
  233. package/dist/tree/shared.js +0 -2
  234. package/dist/tree/tree-util.d.ts +0 -5
  235. package/dist/tree/tree-util.js +0 -5
  236. package/dist/tree-select/foundation.d.ts +26 -22
  237. package/dist/tree-select/foundation.js +91 -86
  238. package/dist/typography/ellipsis.d.ts +5 -7
  239. package/dist/typography/ellipsis.js +8 -10
  240. package/dist/typography/format-numeral.d.ts +1 -1
  241. package/dist/typography/format-numeral.js +2 -2
  242. package/dist/typography/typography.scss +0 -1
  243. package/dist/upload/constants.d.ts +1 -1
  244. package/dist/upload/foundation.d.ts +17 -23
  245. package/dist/upload/foundation.js +93 -103
  246. package/dist/upload/utils.d.ts +3 -8
  247. package/dist/upload/utils.js +6 -11
  248. package/dist/user-guide/foundation.d.ts +3 -5
  249. package/dist/user-guide/foundation.js +19 -19
  250. package/dist/utils/a11y.d.ts +2 -6
  251. package/dist/utils/a11y.js +1 -4
  252. package/dist/utils/announcer.d.ts +2 -2
  253. package/dist/utils/announcer.js +4 -4
  254. package/dist/utils/array.d.ts +0 -6
  255. package/dist/utils/array.js +0 -6
  256. package/dist/utils/date-fns-extra.js +1 -5
  257. package/dist/utils/dom.d.ts +0 -1
  258. package/dist/utils/dom.js +0 -1
  259. package/dist/utils/escape-html.js +0 -3
  260. package/dist/utils/field-sizing.d.ts +0 -2
  261. package/dist/utils/field-sizing.js +0 -2
  262. package/dist/utils/focus-handle.d.ts +1 -2
  263. package/dist/utils/focus-handle.js +1 -3
  264. package/dist/utils/focus-scope.d.ts +5 -6
  265. package/dist/utils/focus-scope.js +10 -11
  266. package/dist/utils/is-promise.d.ts +1 -1
  267. package/dist/utils/release-holder.d.ts +2 -2
  268. package/dist/utils/release-holder.js +4 -4
  269. package/dist/utils/scroll-lock.d.ts +3 -4
  270. package/dist/utils/scroll-lock.js +3 -4
  271. package/dist/utils/tween.d.ts +0 -1
  272. package/dist/utils/tween.js +0 -1
  273. package/dist/utils/uuid.d.ts +0 -1
  274. package/dist/utils/uuid.js +0 -1
  275. package/dist/utils/warning.d.ts +0 -1
  276. package/dist/utils/warning.js +0 -1
  277. package/dist/video-player/foundation.d.ts +15 -15
  278. package/dist/video-player/foundation.js +89 -89
  279. package/dist/video-player/progress-foundation.d.ts +2 -3
  280. package/dist/video-player/progress-foundation.js +12 -13
  281. package/dist/video-player/variables.scss +1 -1
  282. package/package.json +2 -2
@@ -35,7 +35,7 @@ export default class NotificationListStore {
35
35
  icon?: any;
36
36
  getPopupContainer?: () => HTMLElement;
37
37
  theme?: NoticeTheme;
38
- direction?: "ltr" | "rtl";
38
+ direction?: "rtl" | "ltr";
39
39
  className?: string;
40
40
  style?: any;
41
41
  stack?: boolean | number;
@@ -46,11 +46,10 @@ export default class NotificationListStore {
46
46
  };
47
47
  subscribe: (listener: () => void) => () => void;
48
48
  getSnapshot: () => NotificationListState;
49
- /** Shows a notice, or updates the shown one with the same id */
50
- add(notice: NoticeInstance): void;
51
- remove(id: string): void;
52
- finishLeave(id: string): void;
53
- clear(): void;
54
- config(opts: ConfigProps): void;
55
- resetConfig(): void;
49
+ add: (notice: NoticeInstance) => void;
50
+ remove: (id: string) => void;
51
+ finishLeave: (id: string) => void;
52
+ clear: () => void;
53
+ config: (opts: ConfigProps) => void;
54
+ resetConfig: () => void;
56
55
  }
@@ -17,20 +17,19 @@ var NotificationListStore = class {
17
17
  defaults = { ...builtInDefaults };
18
18
  subscribe = (listener) => this.#items.subscribe(listener);
19
19
  getSnapshot = () => this.#items.getSnapshot();
20
- /** Shows a notice, or updates the shown one with the same id */
21
- add(notice) {
20
+ add = (notice) => {
22
21
  this.#items.add(notice);
23
- }
24
- remove(id) {
22
+ };
23
+ remove = (id) => {
25
24
  this.#items.remove(id);
26
- }
27
- finishLeave(id) {
25
+ };
26
+ finishLeave = (id) => {
28
27
  this.#items.finishLeave(id);
29
- }
30
- clear() {
28
+ };
29
+ clear = () => {
31
30
  this.#items.clear();
32
- }
33
- config(opts) {
31
+ };
32
+ config = (opts) => {
34
33
  for (const pos of [
35
34
  "top",
36
35
  "left",
@@ -41,9 +40,9 @@ var NotificationListStore = class {
41
40
  if (typeof opts.duration === "number") this.defaults.duration = opts.duration;
42
41
  if (typeof opts.position === "string") this.defaults.position = opts.position;
43
42
  if ("stack" in opts) this.defaults.stack = opts.stack;
44
- }
45
- resetConfig() {
43
+ };
44
+ resetConfig = () => {
46
45
  this.defaults = { ...builtInDefaults };
47
- }
46
+ };
48
47
  };
49
48
  export { NotificationListStore as default };
@@ -16,7 +16,6 @@ $color-notification_info_light-bg: var(--semi-color-info-light-default); // 彩
16
16
  $color-notification_info_light-border: var(--semi-color-info); // 彩色通知信息描边色
17
17
  $color-notification_danger_light-bg: var(--semi-color-danger-light-default); // 彩色通知危险背景色
18
18
  $color-notification_danger_light-border: var(--semi-color-danger); // 彩色通知危险描边色
19
- // keep equal to bg-0
20
19
  $color-notification_ambient-bg: var(--semi-color-bg-0); // 透明背景色叠加层(与bg0保持一致不建议修改)
21
20
 
22
21
  $width-notification_notice: auto; // 通知宽度
@@ -32,7 +32,6 @@ export interface VisibleLayout {
32
32
  step: 1 | -1;
33
33
  fromStart: boolean;
34
34
  }
35
- /** The props the foundation reads */
36
35
  export interface OverflowListBaseProps {
37
36
  collapseFrom?: 'start' | 'end';
38
37
  items?: Array<Record<string, any>>;
@@ -68,11 +67,10 @@ export default class OverflowListFoundation<P extends OverflowListBaseProps = Ov
68
67
  * object to one position.
69
68
  */
70
69
  static getVisibleLayout({ items, visible }: Pick<OverflowListView, 'items' | 'visible'>, fromStart: boolean, reversed: boolean): VisibleLayout;
71
- /** The view a change of items or style starts from; the measurement then settles it */
72
70
  static resetView({ items, style, renderMode, collapseFrom, itemKey }: OverflowListBaseProps, view: OverflowListView, containerWidth: number): OverflowListView;
73
71
  /** Returns whether the list must be measured again: an item changed width, or every visible item has reported */
74
- recordItemSize(key: ItemKey, width: number, maxCount: number): boolean;
75
- handleKeysChange(keys: ItemKey[]): void;
76
- handleIntersect(entries: Array<IntersectionObserverEntry>): void;
77
- handleCollapseOverflow(): void;
72
+ recordItemSize: (key: ItemKey, width: number, maxCount: number) => boolean;
73
+ handleKeysChange: (keys: ItemKey[]) => void;
74
+ handleIntersect: (entries: Array<IntersectionObserverEntry>) => void;
75
+ handleCollapseOverflow: () => void;
78
76
  }
@@ -20,12 +20,12 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
20
20
  if (!this.isScrollMode()) return;
21
21
  const { items, itemKey } = this.getProps();
22
22
  const scrollOverflow = computeScrollOverflow(items, itemKey, nextVisibleState);
23
- if (scrollOverflow) this._adapter.updateView({ scrollOverflow });
23
+ if (scrollOverflow) this.adapter.updateView({ scrollOverflow });
24
24
  }
25
25
  #notifyOverflow(overflow) {
26
26
  if (!isEqual(this.#notifiedOverflow, overflow)) {
27
27
  this.#notifiedOverflow = overflow;
28
- this._adapter.notifyOverflow(overflow);
28
+ this.adapter.notifyOverflow(overflow);
29
29
  }
30
30
  }
31
31
  isScrollMode() {
@@ -67,7 +67,6 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
67
67
  fromStart
68
68
  };
69
69
  }
70
- /** The view a change of items or style starts from; the measurement then settles it */
71
70
  static resetView({ items, style, renderMode, collapseFrom, itemKey }, view, containerWidth) {
72
71
  const keys = OverflowListFoundation.getItemKeys(items, itemKey);
73
72
  const next = {
@@ -101,21 +100,21 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
101
100
  };
102
101
  }
103
102
  /** Returns whether the list must be measured again: an item changed width, or every visible item has reported */
104
- recordItemSize(key, width, maxCount) {
103
+ recordItemSize = (key, width, maxCount) => {
105
104
  const previous = this.#itemSizes.get(key);
106
105
  this.#itemSizes.set(key, width);
107
106
  return Boolean(previous && previous !== width) || this.#itemSizes.size === maxCount;
108
- }
109
- handleKeysChange(keys) {
107
+ };
108
+ handleKeysChange = (keys) => {
110
109
  const keySet = new Set(keys);
111
110
  this.#itemSizes.forEach((_, key) => keySet.has(key) || this.#itemSizes.delete(key));
112
111
  this.setState({ visibleState: /* @__PURE__ */ new Map() });
113
- }
114
- handleIntersect(entries) {
112
+ };
113
+ handleIntersect = (entries) => {
115
114
  const visibleState = new Map(this.getState("visibleState"));
116
115
  const res = {};
117
116
  entries.forEach((entry) => {
118
- const itemKey = (entry?.target)?.dataset?.scrollkey;
117
+ const itemKey = entry?.target?.getAttribute("data-scrollkey") ?? void 0;
119
118
  const visible = entry.isIntersecting;
120
119
  res[itemKey] = entry;
121
120
  visibleState.set(itemKey, visible);
@@ -128,18 +127,18 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
128
127
  return;
129
128
  }
130
129
  this.#previousY = currentY;
131
- this._adapter.updateVisibleState(visibleState);
130
+ this.adapter.updateVisibleState(visibleState);
132
131
  this.#syncScrollOverflowCache(visibleState);
133
- this._adapter.notifyIntersect(res);
134
- }
135
- handleCollapseOverflow() {
132
+ this.adapter.notifyIntersect(res);
133
+ };
134
+ handleCollapseOverflow = () => {
136
135
  const { minVisibleItems, collapseFrom, itemKey } = this.getProps();
137
136
  const { overflowWidth, containerWidth } = this.getStates();
138
137
  const { items } = this.getProps();
139
138
  let itemWidths = 0, _pivot = 0;
140
139
  let overflowed = false;
141
140
  if (items.length === 0) {
142
- this._adapter.updateView({
141
+ this.adapter.updateView({
143
142
  overflowStatus: "normal",
144
143
  pivot: -1,
145
144
  visible: items,
@@ -159,7 +158,7 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
159
158
  break;
160
159
  }
161
160
  if (isLast) {
162
- this._adapter.updateView({
161
+ this.adapter.updateView({
163
162
  overflowStatus: "normal",
164
163
  pivot: items.length - 1,
165
164
  visible: items,
@@ -173,9 +172,9 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
173
172
  if (overflowed) {
174
173
  const pivot = Math.max(minVisibleItems, _pivot);
175
174
  const isCollapseFromStart = collapseFrom === Boundary.START;
176
- const visible = isCollapseFromStart ? this.getReversedItems().slice(0, pivot).reverse() : items.slice(0, pivot);
177
- const overflow = isCollapseFromStart ? this.getReversedItems().slice(pivot).reverse() : items.slice(pivot);
178
- this._adapter.updateView({
175
+ const visible = isCollapseFromStart ? this.getReversedItems().slice(0, pivot).toReversed() : items.slice(0, pivot);
176
+ const overflow = isCollapseFromStart ? this.getReversedItems().slice(pivot).toReversed() : items.slice(pivot);
177
+ this.adapter.updateView({
179
178
  overflowStatus: "overflowed",
180
179
  pivot,
181
180
  visible,
@@ -184,6 +183,6 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
184
183
  this.#notifyOverflow(overflow);
185
184
  return;
186
185
  }
187
- }
186
+ };
188
187
  };
189
188
  export { OverflowListFoundation as default };
@@ -19,13 +19,11 @@ export interface AdapterPageList {
19
19
  restLeftRange: PageRange;
20
20
  restRightRange: PageRange;
21
21
  }
22
- /** The props the foundation reads */
23
22
  export interface PaginationBaseProps {
24
23
  currentPage?: number;
25
24
  preventPageChangeOnPageSizeChange?: boolean;
26
25
  total?: number;
27
26
  }
28
- /** The state the foundation reads */
29
27
  export interface PaginationBaseState {
30
28
  currentPage: number;
31
29
  pageSize: number;
@@ -50,12 +48,12 @@ export default class PaginationFoundation<P extends PaginationBaseProps = Pagina
50
48
  };
51
49
  static getPageList(currentPage: number, total: number, pageSize: number): AdapterPageList;
52
50
  static getPageSizeOpts(pageSizeOpts: readonly number[], pageSize: number): number[];
53
- goPage(targetPageIndex: number | '...'): void;
54
- updatePage(targetPageIndex?: number, pageSize?: number): void;
55
- goPrev(): void;
56
- goNext(): void;
57
- changePageSize(newPageSize: number): void;
58
- handleQuickJumpNumberChange(targetPage: string | number): void;
59
- handleQuickJumpBlur(): void;
60
- handleQuickJumpEnterPress(targetPage: string): void;
51
+ goPage: (targetPageIndex: number | "...") => void;
52
+ updatePage: (targetPageIndex?: number, pageSize?: number) => void;
53
+ goPrev: () => void;
54
+ goNext: () => void;
55
+ changePageSize: (newPageSize: number) => void;
56
+ handleQuickJumpNumberChange: (targetPage: string | number) => void;
57
+ handleQuickJumpBlur: () => void;
58
+ handleQuickJumpEnterPress: (targetPage: string) => void;
61
59
  }
@@ -10,7 +10,7 @@ var PaginationFoundation = class PaginationFoundation extends BaseFoundation {
10
10
  page = Math.trunc(page);
11
11
  if (page > totalPageNum) page = totalPageNum;
12
12
  if (page <= 0) page = 1;
13
- this._adapter.updateQuickJumpPage("");
13
+ this.adapter.updateQuickJumpPage("");
14
14
  this.goPage(page);
15
15
  }
16
16
  static getInitialState(props) {
@@ -126,50 +126,50 @@ var PaginationFoundation = class PaginationFoundation extends BaseFoundation {
126
126
  const firstLargerIndex = pageSizeOpts.findIndex((el) => el > pageSize);
127
127
  return firstLargerIndex === -1 ? [...pageSizeOpts, pageSize] : pageSizeOpts.toSpliced(firstLargerIndex, 0, pageSize);
128
128
  }
129
- goPage(targetPageIndex) {
129
+ goPage = (targetPageIndex) => {
130
130
  if (targetPageIndex === "...") return;
131
131
  const { pageSize, currentPage } = this.getStates();
132
132
  if (targetPageIndex === currentPage) return;
133
- if (!this._isControlledComponent("currentPage")) this.updatePage(targetPageIndex);
134
- this._adapter.notifyPageChange(targetPageIndex);
135
- this._adapter.notifyChange(targetPageIndex, pageSize);
136
- }
137
- updatePage(targetPageIndex = 1, pageSize) {
133
+ if (!this.isControlledComponent("currentPage")) this.updatePage(targetPageIndex);
134
+ this.adapter.notifyPageChange(targetPageIndex);
135
+ this.adapter.notifyChange(targetPageIndex, pageSize);
136
+ };
137
+ updatePage = (targetPageIndex = 1, pageSize) => {
138
138
  const { currentPage, pageSize: currentPageSize } = this.getStates();
139
139
  const newPageSize = pageSize ?? currentPageSize;
140
- if (targetPageIndex !== currentPage) this._adapter.setCurrentPage(targetPageIndex);
141
- if (newPageSize !== currentPageSize) this._adapter.updatePageSize(newPageSize);
142
- }
143
- goPrev() {
140
+ if (targetPageIndex !== currentPage) this.adapter.setCurrentPage(targetPageIndex);
141
+ if (newPageSize !== currentPageSize) this.adapter.updatePageSize(newPageSize);
142
+ };
143
+ goPrev = () => {
144
144
  const { currentPage } = this.getStates();
145
145
  if (currentPage > 1) this.goPage(currentPage - 1);
146
- }
147
- goNext() {
146
+ };
147
+ goNext = () => {
148
148
  const { currentPage, pageSize } = this.getStates();
149
149
  if (currentPage <= PaginationFoundation.getTotalPageNumber(this.getProp("total"), pageSize) - 1) this.goPage(currentPage + 1);
150
- }
151
- changePageSize(newPageSize) {
150
+ };
151
+ changePageSize = (newPageSize) => {
152
152
  const { pageSize, currentPage } = this.getStates();
153
- this._adapter.updatePageSize(newPageSize);
154
- this._adapter.notifyPageSizeChange(newPageSize);
153
+ this.adapter.updatePageSize(newPageSize);
154
+ this.adapter.notifyPageSizeChange(newPageSize);
155
155
  let newCurrentPage = currentPage;
156
156
  if (!this.getProp("preventPageChangeOnPageSizeChange")) {
157
157
  const currentPageFirstItemIndex = (currentPage - 1) * pageSize + 1;
158
158
  newCurrentPage = Math.ceil(currentPageFirstItemIndex / newPageSize);
159
159
  }
160
- if (!this._isControlledComponent("currentPage")) this.updatePage(newCurrentPage, newPageSize);
161
- if (currentPage !== newCurrentPage) this._adapter.notifyPageChange(newCurrentPage);
162
- this._adapter.notifyChange(newCurrentPage, newPageSize);
163
- }
164
- handleQuickJumpNumberChange(targetPage) {
165
- this._adapter.updateQuickJumpPage(targetPage);
166
- }
167
- handleQuickJumpBlur() {
160
+ if (!this.isControlledComponent("currentPage")) this.updatePage(newCurrentPage, newPageSize);
161
+ if (currentPage !== newCurrentPage) this.adapter.notifyPageChange(newCurrentPage);
162
+ this.adapter.notifyChange(newCurrentPage, newPageSize);
163
+ };
164
+ handleQuickJumpNumberChange = (targetPage) => {
165
+ this.adapter.updateQuickJumpPage(targetPage);
166
+ };
167
+ handleQuickJumpBlur = () => {
168
168
  const { quickJumpPage } = this.getStates();
169
169
  if (typeof quickJumpPage === "string" && quickJumpPage || typeof quickJumpPage === "number") this.#handleQuickJump(quickJumpPage);
170
- }
171
- handleQuickJumpEnterPress(targetPage) {
170
+ };
171
+ handleQuickJumpEnterPress = (targetPage) => {
172
172
  this.#handleQuickJump(targetPage);
173
- }
173
+ };
174
174
  };
175
175
  export { PaginationFoundation as default };
@@ -23,17 +23,14 @@ export interface PinCodeAdapter<P extends PinCodeBaseProps = PinCodeBaseProps, S
23
23
  export default class PinCodeFoundation<P extends PinCodeBaseProps = PinCodeBaseProps, S extends PinCodeBaseState = PinCodeBaseState> extends BaseFoundation<PinCodeAdapter<P, S>, P, S> {
24
24
  static numberReg: RegExp;
25
25
  static mixedReg: RegExp;
26
- handleCurrentActiveIndexChange(index: number, state: 'focus' | 'blur'): void;
26
+ handleCurrentActiveIndexChange: (index: number, state: "focus" | "blur") => void;
27
27
  completeSingleInput(i: number, singleInputValue: string): Promise<void>;
28
28
  /** `data` is the InputEvent or CompositionEvent data of the change, if any */
29
- handleCellChange(index: number, value: string, data?: string | null): void;
29
+ handleCellChange: (index: number, value: string, data?: string | null) => void;
30
30
  validateValue(value?: string): boolean;
31
- updateValueList(newValueList: PinCodeBaseState['valueList']): Promise<void>;
32
- handlePaste(e: ClipboardEvent, startInputIndex: number): Promise<void>;
33
- /**
34
- * Removes the character and closes the gap. Also covers a cell emptied without Backspace or Delete (cut, a
35
- * virtual keyboard's delete).
36
- */
31
+ updateValueList: (newValueList: PinCodeBaseState["valueList"]) => Promise<void>;
32
+ handlePaste: (e: ClipboardEvent, startInputIndex: number) => Promise<void>;
33
+ /** Also covers a cell emptied without Backspace or Delete (cut, a virtual keyboard's delete). */
37
34
  removeCell(index: number): void;
38
- handleKeyDownOnSingleInput(e: KeyboardEvent, index: number): void;
35
+ handleKeyDownOnSingleInput: (e: KeyboardEvent, index: number) => void;
39
36
  }
@@ -3,31 +3,31 @@ import BaseFoundation from "../base/foundation.js";
3
3
  var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
4
4
  static numberReg = /^\d*$/;
5
5
  static mixedReg = /^[0-9a-zA-Z]$/;
6
- handleCurrentActiveIndexChange(index, state) {
7
- if (state === "focus") this._adapter.onCurrentActiveIndexChange(index);
8
- }
6
+ handleCurrentActiveIndexChange = (index, state) => {
7
+ if (state === "focus") this.adapter.onCurrentActiveIndexChange(index);
8
+ };
9
9
  async completeSingleInput(i, singleInputValue) {
10
- const isControlledComponent = this._isControlledComponent("value");
10
+ const isControlledComponent = this.isControlledComponent("value");
11
11
  const index = Math.min(i, this.getState("valueList").length);
12
- await this._adapter.onCurrentActiveIndexChange(index + 1);
12
+ await this.adapter.onCurrentActiveIndexChange(index + 1);
13
13
  const valueList = [...this.getState("valueList")];
14
14
  valueList[index] = singleInputValue;
15
- this._adapter.notifyValueChange(valueList);
15
+ this.adapter.notifyValueChange(valueList);
16
16
  if (!isControlledComponent) await this.updateValueList(valueList);
17
17
  const count = this.getProp("count");
18
- if (index + 1 > count - 1) this._adapter.changeSpecificInputFocusState(index, "blur");
19
- else this._adapter.changeSpecificInputFocusState(index + 1, "focus");
20
- if (valueList.length === count) this._adapter.notifyComplete(valueList.join(""));
18
+ if (index + 1 > count - 1) this.adapter.changeSpecificInputFocusState(index, "blur");
19
+ else this.adapter.changeSpecificInputFocusState(index + 1, "focus");
20
+ if (valueList.length === count) this.adapter.notifyComplete(valueList.join(""));
21
21
  }
22
22
  /** `data` is the InputEvent or CompositionEvent data of the change, if any */
23
- handleCellChange(index, value, data) {
23
+ handleCellChange = (index, value, data) => {
24
24
  if (value === "") {
25
25
  this.removeCell(index);
26
26
  return;
27
27
  }
28
28
  const char = data && Array.from(data).length === 1 ? data : Array.from(value).at(-1);
29
29
  if (this.validateValue(char)) this.completeSingleInput(index, char);
30
- }
30
+ };
31
31
  validateValue(value = "") {
32
32
  const format = this.getProp("format");
33
33
  let validateFunction = (_value) => true;
@@ -41,10 +41,10 @@ var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
41
41
  else if (typeof format === "function") validateFunction = format;
42
42
  return validateFunction(value);
43
43
  }
44
- async updateValueList(newValueList) {
45
- await this._adapter.updateValueList(newValueList);
46
- }
47
- async handlePaste(e, startInputIndex) {
44
+ updateValueList = async (newValueList) => {
45
+ await this.adapter.updateValueList(newValueList);
46
+ };
47
+ handlePaste = async (e, startInputIndex) => {
48
48
  e.preventDefault();
49
49
  const textWillPaste = Array.from(e.clipboardData.getData("text"));
50
50
  const count = this.getProp("count");
@@ -54,33 +54,30 @@ var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
54
54
  if (this.validateValue(currentChar)) await this.completeSingleInput(i, currentChar);
55
55
  else break;
56
56
  }
57
- }
58
- /**
59
- * Removes the character and closes the gap. Also covers a cell emptied without Backspace or Delete (cut, a
60
- * virtual keyboard's delete).
61
- */
57
+ };
58
+ /** Also covers a cell emptied without Backspace or Delete (cut, a virtual keyboard's delete). */
62
59
  removeCell(index) {
63
60
  const valueList = this.getState("valueList").toSpliced(index, 1);
64
61
  this.updateValueList(valueList);
65
- this._adapter.notifyValueChange(valueList);
62
+ this.adapter.notifyValueChange(valueList);
66
63
  }
67
- handleKeyDownOnSingleInput(e, index) {
64
+ handleKeyDownOnSingleInput = (e, index) => {
68
65
  const lastIndex = this.getProp("count") - 1;
69
66
  if (e.key === "Backspace") {
70
67
  this.removeCell(index);
71
- this._adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
68
+ this.adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
72
69
  e.preventDefault();
73
70
  } else if (e.key === "Delete") {
74
71
  this.removeCell(index);
75
72
  e.preventDefault();
76
73
  } else if (e.altKey || e.ctrlKey || e.metaKey) return;
77
74
  else if (e.key === "ArrowLeft") {
78
- this._adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
75
+ this.adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
79
76
  e.preventDefault();
80
77
  } else if (e.key === "ArrowRight") {
81
- this._adapter.changeSpecificInputFocusState(Math.min(lastIndex, index + 1), "focus");
78
+ this.adapter.changeSpecificInputFocusState(Math.min(lastIndex, index + 1), "focus");
82
79
  e.preventDefault();
83
80
  }
84
- }
81
+ };
85
82
  };
86
83
  export { PinCodeFoundation as default };
@@ -3,8 +3,8 @@ export interface PopconfirmAdapter<P extends PopconfirmBaseProps = PopconfirmBas
3
3
  setVisible: (visible: boolean) => void;
4
4
  updateConfirmLoading: (loading: boolean) => void;
5
5
  updateCancelLoading: (loading: boolean) => void;
6
- notifyConfirm: (e: any) => unknown;
7
- notifyCancel: (e: any) => unknown;
6
+ notifyConfirm: (e: MouseEvent) => unknown;
7
+ notifyCancel: (e: MouseEvent) => unknown;
8
8
  notifyVisibleChange: (visible: boolean) => void;
9
9
  focusCancelButton: () => void;
10
10
  focusOkButton: () => void;
@@ -14,25 +14,23 @@ interface FooterButtonProps {
14
14
  autoFocus?: boolean;
15
15
  disabled?: boolean;
16
16
  }
17
- /** The props the foundation reads */
18
17
  export interface PopconfirmBaseProps {
19
18
  cancelButtonProps?: FooterButtonProps;
20
19
  okButtonProps?: FooterButtonProps;
21
20
  visible?: boolean;
22
21
  }
23
- /** The state the foundation reads */
24
22
  export interface PopconfirmBaseState {
25
23
  visible: boolean;
26
24
  cancelLoading: boolean;
27
25
  }
28
26
  export default class PopConfirmFoundation<P extends PopconfirmBaseProps = PopconfirmBaseProps, S extends PopconfirmBaseState = PopconfirmBaseState> extends BaseFoundation<PopconfirmAdapter<P, S>, P, S> {
29
27
  #private;
30
- handleCancel(e: any): void;
31
- handleConfirm(e: any): void;
32
- handleVisibleChange(visible: boolean): void;
28
+ handleCancel: (e: MouseEvent) => void;
29
+ handleConfirm: (e: MouseEvent) => void;
30
+ handleVisibleChange: (visible: boolean) => void;
33
31
  /** Hosts call this when the popup really opens, whoever set `visible` */
34
- handlePopupOpen(): void;
32
+ handlePopupOpen: () => void;
35
33
  /** Hosts call this when the popup really closes, whoever set `visible`; the card is still mounted */
36
- handlePopupClose(): void;
34
+ handlePopupClose: () => void;
37
35
  }
38
36
  export {};
@@ -4,54 +4,54 @@ import isPromise from "../utils/is-promise.js";
4
4
  var PopConfirmFoundation = class extends BaseFoundation {
5
5
  #closeCount = 0;
6
6
  #isOpen() {
7
- return Boolean(this._isControlledComponent("visible") ? this.getProps().visible : this.getStates().visible);
7
+ return Boolean(this.isControlledComponent("visible") ? this.getProps().visible : this.getStates().visible);
8
8
  }
9
9
  #closeIfUnchanged(closeCountAtStart) {
10
10
  if (closeCountAtStart === this.#closeCount && this.#isOpen()) this.handleVisibleChange(false);
11
11
  }
12
- handleCancel(e) {
12
+ handleCancel = (e) => {
13
13
  if (this.getStates().cancelLoading) return;
14
14
  const closeCountAtStart = this.#closeCount;
15
- const maybePromise = this._adapter.notifyCancel(e);
15
+ const maybePromise = this.adapter.notifyCancel(e);
16
16
  if (isPromise(maybePromise)) {
17
- this._adapter.updateCancelLoading(true);
17
+ this.adapter.updateCancelLoading(true);
18
18
  maybePromise.then(() => {
19
19
  this.#closeIfUnchanged(closeCountAtStart);
20
- this._adapter.updateCancelLoading(false);
20
+ this.adapter.updateCancelLoading(false);
21
21
  }, () => {
22
- this._adapter.updateCancelLoading(false);
22
+ this.adapter.updateCancelLoading(false);
23
23
  });
24
24
  } else this.handleVisibleChange(false);
25
- }
26
- handleConfirm(e) {
25
+ };
26
+ handleConfirm = (e) => {
27
27
  const closeCountAtStart = this.#closeCount;
28
- const maybePromise = this._adapter.notifyConfirm(e);
28
+ const maybePromise = this.adapter.notifyConfirm(e);
29
29
  if (isPromise(maybePromise)) {
30
- this._adapter.updateConfirmLoading(true);
30
+ this.adapter.updateConfirmLoading(true);
31
31
  maybePromise.then(() => {
32
- this._adapter.updateConfirmLoading(false);
32
+ this.adapter.updateConfirmLoading(false);
33
33
  this.#closeIfUnchanged(closeCountAtStart);
34
34
  }, () => {
35
- this._adapter.updateConfirmLoading(false);
35
+ this.adapter.updateConfirmLoading(false);
36
36
  });
37
37
  } else this.handleVisibleChange(false);
38
- }
39
- handleVisibleChange(visible) {
40
- if (!this._isControlledComponent("visible") || !visible) this._adapter.setVisible(visible);
38
+ };
39
+ handleVisibleChange = (visible) => {
40
+ if (!this.isControlledComponent("visible") || !visible) this.adapter.setVisible(visible);
41
41
  if (!visible) this.#closeCount++;
42
- this._adapter.notifyVisibleChange(visible);
43
- }
42
+ this.adapter.notifyVisibleChange(visible);
43
+ };
44
44
  /** Hosts call this when the popup really opens, whoever set `visible` */
45
- handlePopupOpen() {
46
- const { cancelButtonProps, okButtonProps } = this._adapter.getProps();
47
- if (cancelButtonProps?.autoFocus && !cancelButtonProps.disabled) this._adapter.focusCancelButton();
48
- else if (okButtonProps?.autoFocus && !okButtonProps.disabled) this._adapter.focusOkButton();
49
- }
45
+ handlePopupOpen = () => {
46
+ const { cancelButtonProps, okButtonProps } = this.adapter.getProps();
47
+ if (cancelButtonProps?.autoFocus && !cancelButtonProps.disabled) this.adapter.focusCancelButton();
48
+ else if (okButtonProps?.autoFocus && !okButtonProps.disabled) this.adapter.focusOkButton();
49
+ };
50
50
  /** Hosts call this when the popup really closes, whoever set `visible`; the card is still mounted */
51
- handlePopupClose() {
52
- this._adapter.setVisible(false);
51
+ handlePopupClose = () => {
52
+ this.adapter.setVisible(false);
53
53
  this.#closeCount++;
54
- this._adapter.focusPrevFocusElement();
55
- }
54
+ this.adapter.focusPrevFocusElement();
55
+ };
56
56
  };
57
57
  export { PopConfirmFoundation as default };
@@ -3,9 +3,6 @@ type StrokeSet = {
3
3
  color: string;
4
4
  };
5
5
  export type StrokeArr = Array<StrokeSet>;
6
- /**
7
- * Picks the stroke color for `percent` from the color stops in `s`. The result is a CSS color expression
8
- * (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render.
9
- */
6
+ /** The result is a CSS color expression (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render. */
10
7
  export declare function generateColor(s: StrokeArr, percent: number, gradient: boolean): string | undefined;
11
8
  export {};
@@ -1,10 +1,7 @@
1
1
  import { strings } from "./constants.js";
2
2
  // src/progress/generates.ts
3
3
  const PALETTE_TOKEN = /^(?:(black|white)|(amber|blue|cyan|green|grey|indigo|light-blue|light-green|lime|orange|pink|purple|red|teal|violet|yellow)(?:-(\d))?)$/;
4
- /**
5
- * Picks the stroke color for `percent` from the color stops in `s`. The result is a CSS color expression
6
- * (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render.
7
- */
4
+ /** The result is a CSS color expression (`var(--semi-...)` or `color-mix()`), so theme switches apply without a re-render. */
8
5
  function generateColor(s, percent, gradient) {
9
6
  if (s.length === 0) return void 0;
10
7
  const sorted = s.toSorted((a, b) => a.percent - b.percent);
@@ -14,5 +14,5 @@ export interface PercentAnimation {
14
14
  /** Cancels the running tween; call on unmount */
15
15
  stop: () => void;
16
16
  }
17
- /** Eases the number shown in the text towards the new percent; a new update or `stop` cancels the running tween */
17
+ /** A new update or `stop` cancels the running tween */
18
18
  export declare function createPercentAnimation(setShown: (value: number) => void): PercentAnimation;
@@ -16,7 +16,7 @@ function calcCircleGeometry(diameter, strokeWidth, percent, indeterminate) {
16
16
  strokeDashoffset: indeterminate ? 0 : (1 - percent / 100) * circumference
17
17
  };
18
18
  }
19
- /** Eases the number shown in the text towards the new percent; a new update or `stop` cancels the running tween */
19
+ /** A new update or `stop` cancels the running tween */
20
20
  function createPercentAnimation(setShown) {
21
21
  let cancel;
22
22
  const stop = () => {