@apple-pie/slice 0.1.10 → 0.1.11

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 (149) hide show
  1. package/dist/cjs/chunks/{Avatar-Czt-12Ih.js → Avatar-CUaQ3kN1.js} +5 -5
  2. package/dist/cjs/chunks/{AvatarGroup-CGH2zY7a.js → AvatarGroup-B3M7o4Hh.js} +23 -20
  3. package/dist/cjs/chunks/{Button-mVVfNCqC.js → Button-ID8wGXIa.js} +12 -11
  4. package/dist/cjs/chunks/{ButtonBar-CFAb4bfQ.js → ButtonBar-BZ6sme27.js} +7 -7
  5. package/dist/cjs/chunks/{Camera-BGV_tNUP.js → Camera-rVC4KI4v.js} +1 -1
  6. package/dist/cjs/chunks/{CheckBox-DyOgP15i.js → CheckBox-DQRLqTAK.js} +1 -1
  7. package/dist/cjs/chunks/{Chip-Z8erRdWG.js → Chip-CflUNqhY.js} +11 -10
  8. package/dist/cjs/chunks/{DivInput-DdZA8S1k.js → DivInput-DrwFMexA.js} +4 -4
  9. package/dist/cjs/chunks/{DropDown-Ce8aU2va.js → DropDown-C3AZ5b_b.js} +49 -50
  10. package/dist/cjs/chunks/{ErrorSummary-By4CjJ9a.js → ErrorSummary-BTgAd3sK.js} +47 -25
  11. package/dist/cjs/chunks/{FileList-CCAtVNDo.js → FileList-BHwBIics.js} +4 -4
  12. package/dist/cjs/chunks/{Grouper-BbovOSYw.js → Grouper-D4yyHHkM.js} +1 -1
  13. package/dist/cjs/chunks/{Icon-N0YJuKQf.js → Icon-D1EB8S5r.js} +6 -5
  14. package/dist/cjs/chunks/{IconButton-BXotgG2u.js → IconButton-B07Ttxbr.js} +11 -11
  15. package/dist/cjs/chunks/Label-CTzvGcds.js +102 -0
  16. package/dist/cjs/chunks/{Pager-Da9AqSFN.js → Pager-BN37VYEC.js} +1 -1
  17. package/dist/cjs/chunks/{ProgressIndicator-CyFcr6Dk.js → ProgressIndicator-BGqIwycX.js} +1 -1
  18. package/dist/cjs/chunks/{PromptInput-D317oh1e.js → PromptInput-D0aehf9X.js} +1 -1
  19. package/dist/cjs/chunks/{RadioButton-B8GIKGm-.js → RadioButton-DuIsM4lu.js} +21 -17
  20. package/dist/cjs/chunks/{RadioButtonList-3o1IvhdC.js → RadioButtonList-bu11ILyw.js} +20 -13
  21. package/dist/cjs/chunks/{Switch-BiTshVLM.js → Switch-Cbn0ql3B.js} +15 -11
  22. package/dist/cjs/chunks/{TabBar-DZ2y7owf.js → TabBar-Bcq_n4Mk.js} +8 -8
  23. package/dist/cjs/chunks/{TextArea-2w4E6d2H.js → TextArea-CEwhpWXT.js} +17 -24
  24. package/dist/cjs/chunks/{TextField-BAcYBHb1.js → TextField-Dl9sTcC4.js} +50 -70
  25. package/dist/cjs/chunks/{Tip-59T3TUN4.js → Tip-BTIo1xG2.js} +7 -6
  26. package/dist/cjs/chunks/{Toast-skIBuJ3b.js → Toast-CZzAWG0S.js} +1 -1
  27. package/dist/cjs/chunks/{UploadArea-CxYAAs7Q.js → UploadArea-z9-1YjIV.js} +6 -6
  28. package/dist/cjs/chunks/{localDBStore-BHEk_9fJ.js → localDBStore-zyDhaEiP.js} +42 -10
  29. package/dist/cjs/components/Avatar/index.js +1 -1
  30. package/dist/cjs/components/AvatarGroup/index.js +2 -2
  31. package/dist/cjs/components/Button/index.js +3 -3
  32. package/dist/cjs/components/ButtonBar/index.js +2 -2
  33. package/dist/cjs/components/Camera/index.js +3 -3
  34. package/dist/cjs/components/CheckBox/index.js +2 -2
  35. package/dist/cjs/components/Chip/index.js +2 -2
  36. package/dist/cjs/components/DivInput/index.js +1 -1
  37. package/dist/cjs/components/DropDown/index.js +2 -2
  38. package/dist/cjs/components/ErrorSummary/index.js +6 -2
  39. package/dist/cjs/components/FileList/index.js +3 -3
  40. package/dist/cjs/components/Grouper/index.js +2 -2
  41. package/dist/cjs/components/Icon/index.js +1 -1
  42. package/dist/cjs/components/IconButton/index.js +2 -2
  43. package/dist/cjs/components/Label/index.js +7 -5
  44. package/dist/cjs/components/Pager/index.js +1 -1
  45. package/dist/cjs/components/Progress/index.js +2 -2
  46. package/dist/cjs/components/PromptInput/index.js +5 -5
  47. package/dist/cjs/components/RadioButton/index.js +2 -2
  48. package/dist/cjs/components/RadioButtonList/index.js +3 -3
  49. package/dist/cjs/components/Switch/index.js +1 -1
  50. package/dist/cjs/components/TabBar/index.js +3 -3
  51. package/dist/cjs/components/TextArea/index.js +4 -4
  52. package/dist/cjs/components/Textfield/index.js +5 -6
  53. package/dist/cjs/components/Tip/index.js +1 -1
  54. package/dist/cjs/components/Toast/index.js +2 -2
  55. package/dist/cjs/components/UploadArea/index.js +4 -4
  56. package/dist/cjs/index.js +8 -3
  57. package/dist/cjs/stores/LocalDB.js +1 -1
  58. package/dist/cjs/stores.js +1 -1
  59. package/dist/esm/chunks/{Avatar-DCCbj2eA.mjs → Avatar-CSLVUF_y.mjs} +5 -5
  60. package/dist/esm/chunks/{AvatarGroup-BaD2Xmda.mjs → AvatarGroup--ELW-bO1.mjs} +23 -20
  61. package/dist/esm/chunks/{Button-m0XAJsq5.mjs → Button-D24zg6UY.mjs} +13 -12
  62. package/dist/esm/chunks/{ButtonBar-CNQHRn77.mjs → ButtonBar-DXK8meQq.mjs} +7 -7
  63. package/dist/esm/chunks/{Camera-7TuowjX_.mjs → Camera-BqmVsVKy.mjs} +2 -2
  64. package/dist/esm/chunks/{CheckBox-DO9hTdv8.mjs → CheckBox-BsaYFNC6.mjs} +1 -1
  65. package/dist/esm/chunks/{Chip-BqneFUOR.mjs → Chip-DdgYV-Ct.mjs} +11 -10
  66. package/dist/esm/chunks/{DivInput-Ch9XjfWd.mjs → DivInput-B7sawFbK.mjs} +4 -4
  67. package/dist/esm/chunks/{DropDown-Cvf2d_3u.mjs → DropDown-DOJvg96J.mjs} +48 -51
  68. package/dist/esm/chunks/{ErrorSummary-S0shes-m.mjs → ErrorSummary-CHLkvdHk.mjs} +52 -27
  69. package/dist/esm/chunks/{FileList-Ckix8gUY.mjs → FileList-5LElsgoE.mjs} +5 -5
  70. package/dist/esm/chunks/{Grouper-B_FutfjV.mjs → Grouper-DR14qDXP.mjs} +1 -1
  71. package/dist/esm/chunks/{Icon-C92f63Ib.mjs → Icon-CUSQtytG.mjs} +6 -5
  72. package/dist/esm/chunks/{IconButton-4O5S9S9G.mjs → IconButton-DG69Vlhj.mjs} +11 -11
  73. package/dist/esm/chunks/Label-CRsE7o3D.mjs +115 -0
  74. package/dist/esm/chunks/{Pager-BlLYeA2F.mjs → Pager-BYT7_mCb.mjs} +1 -1
  75. package/dist/esm/chunks/{ProgressIndicator-CfM2c4ty.mjs → ProgressIndicator-D7paCpgY.mjs} +1 -1
  76. package/dist/esm/chunks/{PromptInput-C6liKbFf.mjs → PromptInput-yf2ir2-x.mjs} +2 -2
  77. package/dist/esm/chunks/{RadioButton-COEnChNW.mjs → RadioButton-B5ZF5oJ_.mjs} +22 -18
  78. package/dist/esm/chunks/{RadioButtonList-De3rbLQb.mjs → RadioButtonList-D9ZAZgkK.mjs} +22 -13
  79. package/dist/esm/chunks/{Switch-Cv6LABsW.mjs → Switch-BhCOo5Lu.mjs} +15 -11
  80. package/dist/esm/chunks/{TabBar-qiozE5zA.mjs → TabBar-BK7OcjPl.mjs} +9 -9
  81. package/dist/esm/chunks/{TextArea-DKRF4Irr.mjs → TextArea-CWmzQA0V.mjs} +18 -25
  82. package/dist/esm/chunks/{TextField-CGOR6507.mjs → TextField-6Aq-AT47.mjs} +54 -72
  83. package/dist/esm/chunks/{Tip-CroDIKO4.mjs → Tip-DfmcLbBf.mjs} +7 -6
  84. package/dist/esm/chunks/{Toast-CM493gMR.mjs → Toast-DPHLwDES.mjs} +1 -1
  85. package/dist/esm/chunks/{UploadArea-DNAH-Bu5.mjs → UploadArea-igD1l2Ht.mjs} +8 -8
  86. package/dist/esm/chunks/{localDBStore-C-Ch2MFq.mjs → localDBStore-B4jkR5Jx.mjs} +42 -10
  87. package/dist/esm/components/Avatar/index.mjs +1 -1
  88. package/dist/esm/components/AvatarGroup/index.mjs +2 -2
  89. package/dist/esm/components/Button/index.mjs +3 -3
  90. package/dist/esm/components/ButtonBar/index.mjs +2 -2
  91. package/dist/esm/components/Camera/index.mjs +3 -3
  92. package/dist/esm/components/CheckBox/index.mjs +2 -2
  93. package/dist/esm/components/Chip/index.mjs +2 -2
  94. package/dist/esm/components/DivInput/index.mjs +1 -1
  95. package/dist/esm/components/DropDown/index.mjs +5 -5
  96. package/dist/esm/components/ErrorSummary/index.mjs +21 -1
  97. package/dist/esm/components/FileList/index.mjs +3 -3
  98. package/dist/esm/components/Grouper/index.mjs +2 -2
  99. package/dist/esm/components/Icon/index.mjs +1 -1
  100. package/dist/esm/components/IconButton/index.mjs +2 -2
  101. package/dist/esm/components/Label/index.mjs +1 -19
  102. package/dist/esm/components/Pager/index.mjs +1 -1
  103. package/dist/esm/components/Progress/index.mjs +2 -2
  104. package/dist/esm/components/PromptInput/index.mjs +5 -5
  105. package/dist/esm/components/RadioButton/index.mjs +2 -2
  106. package/dist/esm/components/RadioButtonList/index.mjs +4 -4
  107. package/dist/esm/components/Switch/index.mjs +1 -1
  108. package/dist/esm/components/TabBar/index.mjs +3 -3
  109. package/dist/esm/components/TextArea/index.mjs +4 -4
  110. package/dist/esm/components/Textfield/index.mjs +7 -7
  111. package/dist/esm/components/Tip/index.mjs +1 -1
  112. package/dist/esm/components/Toast/index.mjs +2 -2
  113. package/dist/esm/components/UploadArea/index.mjs +4 -4
  114. package/dist/esm/index.mjs +27 -27
  115. package/dist/esm/stores/LocalDB.mjs +1 -1
  116. package/dist/esm/stores.mjs +1 -1
  117. package/dist/types/components/Avatar/_types.d.ts +3 -0
  118. package/dist/types/components/AvatarGroup/_types.d.ts +3 -0
  119. package/dist/types/components/Button/Button.d.ts +6 -2
  120. package/dist/types/components/Button/_types.d.ts +3 -1
  121. package/dist/types/components/ButtonBar/_types.d.ts +4 -0
  122. package/dist/types/components/Chip/_types.d.ts +5 -1
  123. package/dist/types/components/DivInput/_types.d.ts +2 -0
  124. package/dist/types/components/DropDown/DropDown.d.ts +2 -3
  125. package/dist/types/components/DropDown/_types.d.ts +20 -14
  126. package/dist/types/components/ErrorSummary/ErrorSummary.d.ts +1 -2
  127. package/dist/types/components/ErrorSummary/_types.d.ts +7 -4
  128. package/dist/types/components/FileList/_types.d.ts +1 -0
  129. package/dist/types/components/IconButton/_types.d.ts +3 -0
  130. package/dist/types/components/Label/Label.d.ts +1 -1
  131. package/dist/types/components/Label/_types.d.ts +18 -8
  132. package/dist/types/components/Label/index.d.ts +1 -0
  133. package/dist/types/components/RadioButton/RadioButton.d.ts +1 -1
  134. package/dist/types/components/RadioButton/_types.d.ts +12 -11
  135. package/dist/types/components/RadioButtonList/RadioButtonList.d.ts +1 -1
  136. package/dist/types/components/RadioButtonList/_types.d.ts +8 -6
  137. package/dist/types/components/Switch/Switch.d.ts +1 -1
  138. package/dist/types/components/Switch/_types.d.ts +7 -3
  139. package/dist/types/components/TabBar/_types.d.ts +2 -2
  140. package/dist/types/components/TextArea/_types.d.ts +5 -6
  141. package/dist/types/components/Textfield/_types.d.ts +14 -20
  142. package/dist/types/components/Tip/_types.d.ts +4 -1
  143. package/dist/types/components/UploadArea/UploadArea.d.ts +10 -2
  144. package/dist/types/components/UploadArea/_types.d.ts +5 -1
  145. package/dist/types/components/playHelpers.d.ts +1 -1
  146. package/dist/types/index.d.ts +1 -0
  147. package/package.json +1 -1
  148. package/dist/cjs/chunks/Label-CZvJbATa.js +0 -118
  149. package/dist/esm/chunks/Label-7ezP3eHw.mjs +0 -131
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import type { DropDownOption, DropDownProps } from './_types';
3
- export type { DropDownOption };
4
- export declare const DropDown: React.MemoExoticComponent<(props: DropDownProps) => import("react/jsx-runtime").JSX.Element>;
2
+ import type { DropDownProps } from './_types';
3
+ export declare const DropDown: <T = string>(props: DropDownProps<T>) => React.JSX.Element;
@@ -1,34 +1,40 @@
1
1
  import type React from 'react';
2
- export type DropDownOption = {
2
+ export type DropDownOption<T = string> = {
3
3
  label?: string;
4
- value?: string;
4
+ value?: T;
5
5
  alt?: string;
6
6
  };
7
- type DropDownBaseProps = {
7
+ type DropDownBaseProps<T = string> = {
8
8
  name?: string;
9
- options?: DropDownOption[];
9
+ label?: string;
10
+ labelColor?: string;
11
+ options?: DropDownOption<T>[];
10
12
  selectedIndex?: number;
11
- selectedValue?: string;
13
+ selectedValue?: T;
14
+ valueKey?: string;
12
15
  placeholder?: boolean;
13
16
  borderRadius?: number;
17
+ borderStyle?: 'bottom' | 'box' | 'none';
14
18
  validate?: boolean;
15
19
  iconColor?: string;
20
+ backgroundColor?: string;
16
21
  bgColor?: string;
22
+ textColor?: string;
23
+ borderColor?: string;
24
+ borderWidth?: number;
25
+ borderSize?: number;
17
26
  width?: string;
18
27
  height?: string;
19
28
  paddingLeft?: number | string;
20
29
  paddingRight?: number | string;
21
- paddingTops?: number | string;
30
+ paddingTop?: number | string;
31
+ paddingBottom?: number | string;
22
32
  iconSize?: number;
23
33
  disabled?: boolean;
24
- unframed?: boolean;
25
- focused?: boolean;
34
+ error?: boolean;
26
35
  gap?: number;
27
- size?: 'small' | 'medium' | 'large';
28
- onChange?: (index: number, option: DropDownOption) => void;
29
- onBlur?: (value: string) => void;
30
- onValidate?: (state: boolean) => void;
31
- onFocus?: () => void;
36
+ size?: 'xs' | 's' | 'm' | 'l';
37
+ onChange?: (index: number, option: DropDownOption<T>) => void;
32
38
  };
33
- export type DropDownProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof DropDownBaseProps> & DropDownBaseProps;
39
+ export type DropDownProps<T = string> = Omit<React.HTMLAttributes<HTMLDivElement>, keyof DropDownBaseProps<T>> & DropDownBaseProps<T>;
34
40
  export {};
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import type { ErrorMessage, ErrorSummaryProps } from './_types';
3
- export type { ErrorMessage };
2
+ import type { ErrorSummaryProps } from './_types';
4
3
  export declare const ErrorSummary: React.MemoExoticComponent<(props: ErrorSummaryProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,12 +1,15 @@
1
1
  import type React from 'react';
2
2
  export type ErrorMessage = {
3
- id?: string;
4
- title?: string;
5
- bullets?: string[];
3
+ title: string;
4
+ message?: string | string[];
6
5
  };
7
6
  type ErrorSummaryBaseProps = {
8
7
  entries?: ErrorMessage[];
9
- errors?: any[];
8
+ textColor?: string;
9
+ autoNumber?: boolean;
10
+ backgroundColor?: string;
11
+ bgColor?: string;
12
+ textSize?: 'xs' | 's' | 'm' | 'l';
10
13
  };
11
14
  export type ErrorSummaryProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof ErrorSummaryBaseProps> & ErrorSummaryBaseProps;
12
15
  export {};
@@ -16,6 +16,7 @@ type FileListBaseProps = {
16
16
  padding?: number | string;
17
17
  iconSize?: number;
18
18
  onChange?: (files: FileItem[]) => void;
19
+ backgroundColor?: string;
19
20
  bgColor?: string;
20
21
  canRemove?: boolean;
21
22
  onToolTip?: (tip: ToolTip | null) => void;
@@ -5,6 +5,9 @@ type IconButtonBaseProps = {
5
5
  frameSize?: number;
6
6
  iconSize?: number;
7
7
  icon?: string;
8
+ iconColor?: string;
9
+ iconColorOn?: string;
10
+ iconColorHover?: string;
8
11
  tooltip?: string;
9
12
  color?: string;
10
13
  colorOn?: string;
@@ -1,2 +1,2 @@
1
- import type { LabelProps } from './_types';
1
+ import { type LabelProps } from './_types';
2
2
  export declare function Label(props: Readonly<LabelProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,25 @@
1
1
  import type React from 'react';
2
+ export declare enum LabelBackground {
3
+ red = "red",
4
+ yellow = "yellow",
5
+ green = "green",
6
+ blue = "blue",
7
+ grey = "grey",
8
+ lightGrey = "lightGrey",
9
+ white = "white"
10
+ }
2
11
  type LabelBaseProps = {
3
12
  children?: React.ReactNode;
4
- state?: 'red' | 'yellow' | 'green' | 'blue' | 'grey' | 'lightgrey' | 'white';
5
- noFill?: boolean;
6
- round?: boolean;
7
- button?: boolean;
8
- border?: number;
13
+ label?: string;
14
+ backgroundColor?: LabelBackground | string;
15
+ bgColor?: LabelBackground | string;
16
+ borderWidth?: number;
17
+ borderSize?: number;
18
+ borderColor?: string;
19
+ borderRadius?: number;
9
20
  padding?: number | string;
10
- inline?: boolean;
11
- color?: string;
12
- size?: 's' | 'm' | 'l';
21
+ textColor?: string;
22
+ textSize?: 'xs' | 's' | 'm' | 'l';
13
23
  onClick?: (e: React.MouseEvent<any>) => void;
14
24
  };
15
25
  export type LabelProps = Omit<React.HTMLAttributes<HTMLElement>, keyof LabelBaseProps> & LabelBaseProps;
@@ -1,2 +1,3 @@
1
1
  export { Label } from './Label';
2
+ export { LabelBackground } from './_types';
2
3
  export type { LabelProps } from './_types';
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { RadioButtonProps } from './_types';
3
- export declare const RadioButton: React.MemoExoticComponent<(props: RadioButtonProps) => import("react/jsx-runtime").JSX.Element>;
3
+ export declare const RadioButton: <T = string>(props: RadioButtonProps<T>) => React.JSX.Element;
@@ -1,26 +1,27 @@
1
1
  import type React from 'react';
2
- export type RadioButtonOption = {
2
+ export type RadioButtonOption<T = string> = {
3
3
  fieldName?: string;
4
- title?: string;
5
- description?: string;
6
- state?: boolean;
7
- icon?: string;
4
+ label?: string;
5
+ value?: T;
8
6
  };
9
- type RadioButtonBaseProps = {
7
+ type RadioButtonBaseProps<T = string> = {
8
+ children?: React.ReactNode;
9
+ label?: string;
10
+ fieldName?: string;
11
+ value?: T;
10
12
  selected?: boolean;
11
- option: RadioButtonOption;
12
13
  controlType?: 'radio' | 'checkbox';
13
14
  deselect?: boolean;
14
15
  tabIndex?: number;
15
16
  wrap?: boolean;
16
17
  list?: boolean;
17
18
  hideRadio?: boolean;
18
- toggleIcon?: boolean;
19
19
  iconColor?: string;
20
20
  noFrame?: boolean;
21
21
  gap?: number;
22
- checkedIcon?: 'check circle' | 'circle fill';
23
- onChange?: (option: RadioButtonOption, state: boolean) => void;
22
+ icon?: string;
23
+ checkedIcon?: string;
24
+ onChange?: (option: RadioButtonOption<T>, selected: boolean) => void;
24
25
  };
25
- export type RadioButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof RadioButtonBaseProps> & RadioButtonBaseProps;
26
+ export type RadioButtonProps<T = string> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof RadioButtonBaseProps> & RadioButtonBaseProps<T>;
26
27
  export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { RadioButtonListProps } from './_types';
3
- export declare const RadioButtonList: React.MemoExoticComponent<(props: RadioButtonListProps) => import("react/jsx-runtime").JSX.Element>;
3
+ export declare const RadioButtonList: <T = string>(props: RadioButtonListProps<T>) => React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
- import type { RadioButtonOption } from '../RadioButton/_types';
3
- type RadioButtonListBaseProps = {
4
- options?: RadioButtonOption[];
2
+ import type { RadioButtonOption } from '../RadioButton';
3
+ type RadioButtonListBaseProps<T = string> = {
4
+ options?: RadioButtonOption<T>[];
5
5
  selectedIndexes?: number[] | null;
6
6
  selectedOptions?: string[] | null;
7
7
  label?: string | null;
@@ -17,8 +17,10 @@ type RadioButtonListBaseProps = {
17
17
  iconColor?: string;
18
18
  iconSelectedColor?: string;
19
19
  noFrame?: boolean;
20
- checkedIcon?: 'check circle' | 'circle fill';
21
- onChange?: (options: RadioButtonOption[] | null, indexes: number[] | null) => void;
20
+ icon?: string;
21
+ checkedIcon?: string;
22
+ width?: number | string;
23
+ onChange?: (options: RadioButtonOption<T>[] | null, indexes: number[] | null) => void;
22
24
  };
23
- export type RadioButtonListProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof RadioButtonListBaseProps> & RadioButtonListBaseProps;
25
+ export type RadioButtonListProps<T = string> = Omit<React.HTMLAttributes<HTMLDivElement>, keyof RadioButtonListBaseProps> & RadioButtonListBaseProps<T>;
24
26
  export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { SwitchProps } from './_types';
3
- export declare const Switch: React.MemoExoticComponent<(props: SwitchProps) => import("react/jsx-runtime").JSX.Element>;
3
+ export declare const Switch: <T = string>(props: SwitchProps<T>) => React.JSX.Element;
@@ -1,13 +1,17 @@
1
1
  import type React from 'react';
2
- type SwitchBaseProps = {
2
+ type SwitchBaseProps<T = string> = {
3
+ fieldName?: string;
3
4
  state?: boolean;
4
5
  height?: number;
5
6
  width?: number;
7
+ backgroundColorOff?: string;
8
+ backgroundColorOn?: string;
6
9
  bgColorOff?: string;
7
10
  bgColorOn?: string;
8
11
  knobColor?: string;
9
12
  padding?: number;
10
- onChange?: (state: boolean) => void;
13
+ value?: T;
14
+ onChange?: (value: T | undefined, state: boolean) => void;
11
15
  };
12
- export type SwitchProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof SwitchBaseProps> & SwitchBaseProps;
16
+ export type SwitchProps<T = string> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof SwitchBaseProps> & SwitchBaseProps<T>;
13
17
  export {};
@@ -17,7 +17,7 @@ type TabBarBaseProps = {
17
17
  selectedValue?: string;
18
18
  height?: number | string;
19
19
  width?: number | string;
20
- tabWidth?: 'min-content' | 'distribute' | number;
20
+ tabWidth?: 'compact' | 'fill' | number;
21
21
  closeWidth?: number | string;
22
22
  padding?: number | string;
23
23
  iconSize?: number;
@@ -42,7 +42,7 @@ export interface TabOptionProps {
42
42
  iconGap?: number;
43
43
  disabled?: boolean;
44
44
  count?: number;
45
- tabWidth?: 'min-content' | 'distribute' | number;
45
+ tabWidth?: 'compact' | 'fill' | number;
46
46
  underline?: boolean;
47
47
  onClick?: (value: number) => void;
48
48
  onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>, value: number) => void;
@@ -3,13 +3,12 @@ type TextAreaBaseProps = {
3
3
  value?: string;
4
4
  name?: string;
5
5
  width?: number | string;
6
- height?: number | string;
7
6
  minWidth?: number | string;
8
7
  rows?: number;
9
8
  focused?: boolean;
10
9
  placeholder?: string;
11
10
  padding?: number | string;
12
- validate?: boolean;
11
+ error?: boolean;
13
12
  border?: boolean;
14
13
  resizable?: boolean;
15
14
  hasSend?: boolean;
@@ -18,17 +17,17 @@ type TextAreaBaseProps = {
18
17
  right: number;
19
18
  };
20
19
  sendSize?: number;
20
+ backgroundColor?: string;
21
21
  bgColor?: string;
22
22
  borderRadius?: number;
23
23
  returnSubmits?: boolean;
24
- textSize?: 's' | 'm' | 'l';
24
+ textSize?: 'xs' | 's' | 'm' | 'l';
25
25
  disabled?: boolean;
26
26
  submitClears?: boolean;
27
27
  onChange?: (value: string) => void;
28
28
  onSubmit?: (value: string) => void;
29
- onFocus?: () => void;
30
- onBlur?: () => void;
31
- onValidate?: (state: boolean) => void;
29
+ onFocus?: (value: string) => void;
30
+ onBlur?: (value: string) => void;
32
31
  onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
33
32
  };
34
33
  export type TextAreaProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof TextAreaBaseProps> & TextAreaBaseProps;
@@ -4,8 +4,8 @@ type TextFieldBaseProps = {
4
4
  value?: string;
5
5
  name?: string;
6
6
  label?: string;
7
- labelSize?: 's' | 'm' | 'l';
8
- textSize?: 's' | 'm' | 'l';
7
+ labelSize?: 'xs' | 's' | 'm' | 'l';
8
+ textSize?: 'xs' | 's' | 'm' | 'l';
9
9
  placeholder?: string;
10
10
  focused?: boolean;
11
11
  editable?: boolean;
@@ -25,26 +25,20 @@ type TextFieldBaseProps = {
25
25
  width?: number | string;
26
26
  height?: number | string;
27
27
  };
28
- padding?: string;
28
+ padding?: string | number;
29
29
  borderRadius?: number | string;
30
30
  textAlign?: 'left' | 'center';
31
- borderColor?: {
32
- focused: string;
33
- blurred: string;
34
- error: string;
35
- };
36
- backgroundColor?: {
37
- focused: string;
38
- blurred: string;
39
- };
40
- color?: {
41
- focused: string;
42
- blurred: string;
43
- error: string;
44
- placeholder: string;
45
- disabled: string;
46
- label: string;
47
- };
31
+ borderColorFocused?: string;
32
+ borderColorBlurred?: string;
33
+ borderColorError?: string;
34
+ backgroundColorFocused?: string;
35
+ backgroundColorBlurred?: string;
36
+ textColorFocused?: string;
37
+ textColorBlurred?: string;
38
+ textColorError?: string;
39
+ textColorPlaceholder?: string;
40
+ textColorDisabled?: string;
41
+ labelColor?: string;
48
42
  validate?: boolean;
49
43
  iconLeft?: {
50
44
  name?: string;
@@ -10,12 +10,15 @@ export type PosCoords = {
10
10
  };
11
11
  type ToolTipBaseProps = {
12
12
  tip?: ToolTip | null;
13
- size?: 's' | 'm' | 'l';
13
+ size?: 'xs' | 's' | 'm' | 'l';
14
+ backgroundColor?: string;
14
15
  bgColor?: string;
16
+ textColor?: string;
15
17
  color?: string;
16
18
  border?: boolean;
17
19
  borderColor?: string;
18
20
  padding?: number | string;
21
+ borderRadius?: number;
19
22
  radius?: number;
20
23
  coords?: {
21
24
  x: number;
@@ -9,14 +9,18 @@ export declare const UploadArea: React.NamedExoticComponent<Omit<React.HTMLAttri
9
9
  title?: string;
10
10
  message?: string;
11
11
  busyMessage?: string;
12
+ backgroundColor?: string;
13
+ backgroundColorHover?: string;
12
14
  bgColor?: string;
13
15
  bgColorHover?: string;
16
+ borderWidth?: number;
14
17
  border?: number;
15
18
  borderColor?: string | null;
16
19
  borderColorHover?: string | null;
17
20
  borderStyle?: string;
18
- textSize?: "s" | "m" | "l";
21
+ textSize?: "xs" | "s" | "m" | "l";
19
22
  padding?: number | string;
23
+ borderRadius?: number | string;
20
24
  radius?: number | string;
21
25
  acceptedTypes?: string[];
22
26
  multiple?: boolean;
@@ -35,14 +39,18 @@ export declare const UploadArea: React.NamedExoticComponent<Omit<React.HTMLAttri
35
39
  title?: string;
36
40
  message?: string;
37
41
  busyMessage?: string;
42
+ backgroundColor?: string;
43
+ backgroundColorHover?: string;
38
44
  bgColor?: string;
39
45
  bgColorHover?: string;
46
+ borderWidth?: number;
40
47
  border?: number;
41
48
  borderColor?: string | null;
42
49
  borderColorHover?: string | null;
43
50
  borderStyle?: string;
44
- textSize?: "s" | "m" | "l";
51
+ textSize?: "xs" | "s" | "m" | "l";
45
52
  padding?: number | string;
53
+ borderRadius?: number | string;
46
54
  radius?: number | string;
47
55
  acceptedTypes?: string[];
48
56
  multiple?: boolean;
@@ -25,14 +25,18 @@ type UploadAreaBaseProps = {
25
25
  title?: string;
26
26
  message?: string;
27
27
  busyMessage?: string;
28
+ backgroundColor?: string;
29
+ backgroundColorHover?: string;
28
30
  bgColor?: string;
29
31
  bgColorHover?: string;
32
+ borderWidth?: number;
30
33
  border?: number;
31
34
  borderColor?: string | null;
32
35
  borderColorHover?: string | null;
33
36
  borderStyle?: string;
34
- textSize?: 's' | 'm' | 'l';
37
+ textSize?: 'xs' | 's' | 'm' | 'l';
35
38
  padding?: number | string;
39
+ borderRadius?: number | string;
36
40
  radius?: number | string;
37
41
  acceptedTypes?: string[];
38
42
  multiple?: boolean;
@@ -9,7 +9,7 @@ export declare function runDivInputPlay<TArgs>({ args, canvasElement, }: PlayCon
9
9
  export declare function runDotPlay<TArgs>({ canvasElement }: PlayContext<TArgs>): Promise<void>;
10
10
  export declare function runDraggablePanelPlay<TArgs>({ canvasElement, args, }: PlayContext<TArgs>): Promise<void>;
11
11
  export declare function runDropDownPlay<TArgs>({ args, canvasElement, }: PlayContext<TArgs>): Promise<void>;
12
- export declare function runErrorSummaryPlay<TArgs>({ canvasElement, }: PlayContext<TArgs>): Promise<void>;
12
+ export declare function runErrorSummaryPlay<TArgs>({ args, canvasElement, }: PlayContext<TArgs>): Promise<void>;
13
13
  export declare function runFlexDivPlay<TArgs>({ canvasElement, }: PlayContext<TArgs>): Promise<void>;
14
14
  export declare function runGrouperPlay<TArgs>({ args, canvasElement, }: PlayContext<TArgs>): Promise<void>;
15
15
  export declare function runIconPlay<TArgs>({ args, canvasElement, }: PlayContext<TArgs>): Promise<void>;
@@ -68,6 +68,7 @@ export type { IconProps } from './components/Icon/_types';
68
68
  export { ButtonBar } from './components/ButtonBar';
69
69
  export type { BarButton, ButtonBarProps } from './components/ButtonBar/_types';
70
70
  export { Label } from './components/Label';
71
+ export { LabelBackground } from './components/Label';
71
72
  export type { LabelProps } from './components/Label';
72
73
  export { UploadArea } from './components/UploadArea';
73
74
  export type { UploadAreaProps } from './components/UploadArea/_types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apple-pie/slice",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_useTheme = require("../hooks/useTheme.js");
4
-
5
- require("../theme/colors.js"), require("../hooks/useWindow.js");
6
-
7
- var misc = require("./misc-BTF7BCZW.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css = {
8
- label: "Label-module_label__RaRvM flexBox-module_row__z24tF",
9
- button: "Label-module_button__N8bcQ type-module_body-m-regular__LuQBA",
10
- s: "Label-module_s__Zh8Gp type-module_body-s-regular__vRHSP",
11
- m: "Label-module_m__BJtGL type-module_body-m-regular__LuQBA",
12
- l: "Label-module_l__t70tt type-module_body-l-regular__lOYbg",
13
- red: "Label-module_red__yqrNW",
14
- green: "Label-module_green__R6cDO",
15
- yellow: "Label-module_yellow__IoDDg",
16
- grey: "Label-module_grey__qIkSh",
17
- lightgrey: "Label-module_lightgrey__nZC6N",
18
- white: "Label-module_white__OFwCs",
19
- blue: "Label-module_blue__lqM0T"
20
- };
21
-
22
- styleInject_es.styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.Label-module_label__RaRvM {\n\tdisplay: var(--label-inline) !important;\n\tline-height: 1em;\n\twhite-space: nowrap;\n\tpadding: var(--label-padding) !important;\n\twidth: min-content;\n\tcolor: var(--label-color);\n\tborder-radius: var(--label-border-radius);\n\tborder: var(--label-border-size) solid var(--core-outline-primary);\n\tcursor: var(--label-cursor);\n}\n\n.Label-module_button__N8bcQ {\n\tappearance: none;\n\t-webkit-appearance: none;\n\tbackground-image: none;\n\toutline: none;\n}\n\n.Label-module_s__Zh8Gp {\n}\n\n.Label-module_m__BJtGL {\n}\n\n.Label-module_l__t70tt {\n}\n\n.Label-module_red__yqrNW {\n\tbackground: var(--label-background);\n\tcolor: var(--core-text-light);\n\tborder-color: var(--label-border-color-red);\n}\n\n.Label-module_green__R6cDO {\n\tbackground: var(--label-background);\n\tcolor: var(--core-text-light);\n\tborder-color: var(--label-border-color-green);\n}\n\n.Label-module_yellow__IoDDg {\n\tbackground: var(--label-background);\n\tcolor: var(--core-text-primary);\n\tborder-color: var(--label-border-color-yellow);\n}\n\n.Label-module_grey__qIkSh {\n\tbackground: var(--label-background);\n\tcolor: var(--core-text-secondary);\n\tborder-color: var(--label-border-color-grey);\n}\n\n.Label-module_lightgrey__nZC6N {\n\tbackground: var(--label-background);\n\tcolor: var(--core-text-disabled);\n\tborder-color: var(--label-border-color-lightgrey);\n}\n\n.Label-module_white__OFwCs {\n\tbackground: var(--label-background);\n\tcolor: var(--core-text-primary);\n\tborder-color: var(--label-border-color-white);\n}\n\n.Label-module_blue__lqM0T {\n\tbackground: var(--label-background);\n\tcolor: var(--core-text-light);\n\tborder-color: var(--label-border-color-blue);\n}\n"),
23
- exports.Label = function(props) {
24
- const theme = hooks_useTheme.useTheme(), {children: children, state: state, noFill: noFill = !1, button: button = !1, round: round = !1, border: border = 1, padding: padding, color: color, inline: inline = !0, size: size = "m", onClick: onClick} = props, divAttributes = tslib_es6.__rest(props, [ "children", "state", "noFill", "button", "round", "border", "padding", "color", "inline", "size", "onClick" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", isInteractive = Boolean(onClick), handleClick = React.useCallback(e => {
25
- isInteractive && (null == onClick || onClick(e));
26
- }, [ isInteractive, onClick ]), backgroundColor = React.useMemo(() => {
27
- if (noFill) return "var(--core-surface-primary)";
28
- switch (state) {
29
- case "red":
30
- case "green":
31
- return theme.current.colors["feedback-warning"];
32
-
33
- case "yellow":
34
- return theme.current.colors["array-yellow"];
35
-
36
- case "grey":
37
- case "white":
38
- return theme.current.colors["core-surface-secondary"];
39
-
40
- case "lightgrey":
41
- return theme.current.colors["core-button-disabled"];
42
-
43
- case "blue":
44
- return theme.current.colors["core-button-primary"];
45
-
46
- default:
47
- return "var(--core-surface-primary)";
48
- }
49
- }, [ noFill, state, theme ]), borderColors = React.useMemo(() => {
50
- const getBorderColor = colorState => {
51
- switch (colorState) {
52
- case "red":
53
- return theme.current.colors["core-button-disabled"];
54
-
55
- case "green":
56
- return noFill ? theme.current.colors["feedback-positive"] : theme.current.colors["core-button-disabled"];
57
-
58
- case "yellow":
59
- return theme.current.colors["array-yellow-label"];
60
-
61
- case "grey":
62
- return noFill ? theme.current.colors["core-text-secondary"] : theme.current.colors["core-button-disabled"];
63
-
64
- case "lightgrey":
65
- return noFill ? theme.current.colors["core-outline-primary"] : theme.current.colors["core-button-disabled"];
66
-
67
- case "white":
68
- return noFill ? theme.current.colors["core-text-secondary"] : theme.current.colors["core-badge-secondary"];
69
-
70
- case "blue":
71
- return noFill ? theme.current.colors["core-text-secondary"] : theme.current.colors["core-button-primary"];
72
-
73
- default:
74
- return "var(--core-outline-primary)";
75
- }
76
- };
77
- return {
78
- red: getBorderColor("red"),
79
- green: getBorderColor("green"),
80
- yellow: getBorderColor("yellow"),
81
- grey: getBorderColor("grey"),
82
- lightgrey: getBorderColor("lightgrey"),
83
- white: getBorderColor("white"),
84
- blue: getBorderColor("blue")
85
- };
86
- }, [ noFill, theme ]), setPadding = React.useMemo(() => padding ? misc.setStyle(padding) : button ? "6px 12px" : "4px 6px", [ padding, button ]), cssVars = React.useMemo(() => ({
87
- "--label-padding": setPadding,
88
- "--label-border-radius": round ? "100px" : "4px",
89
- "--label-cursor": button ? "pointer" : "default",
90
- "--label-color": null != color ? color : "var(--core-text-primary)",
91
- "--label-background": backgroundColor,
92
- "--label-border-size": border ? `${border}px` : "0",
93
- "--label-border-color-red": borderColors.red,
94
- "--label-border-color-green": borderColors.green,
95
- "--label-border-color-yellow": borderColors.yellow,
96
- "--label-border-color-grey": borderColors.grey,
97
- "--label-border-color-lightgrey": borderColors.lightgrey,
98
- "--label-border-color-white": borderColors.white,
99
- "--label-border-color-blue": borderColors.blue,
100
- "--label-inline": inline ? "inline-flex" : "flex"
101
- }), [ button, border, round, backgroundColor, borderColors, setPadding, color, inline ]), classNames = [ css.label, button || isInteractive ? css.button : css.regular, state ? css[state] : "" ].filter(Boolean).join(" ");
102
- return isInteractive ? jsxRuntime.jsx("button", Object.assign({
103
- id: divId,
104
- type: "button",
105
- className: `${classNames} ${css[size]}${divClass}`,
106
- style: Object.assign(Object.assign({}, divStyle), cssVars),
107
- "aria-label": "Label button",
108
- onClick: e => handleClick(e)
109
- }, rest, {
110
- children: children
111
- })) : jsxRuntime.jsx("span", Object.assign({
112
- id: divId,
113
- className: `${classNames} ${css[size]}${divClass}`,
114
- style: Object.assign(Object.assign({}, divStyle), cssVars)
115
- }, rest, {
116
- children: children
117
- }));
118
- };