@usefragments/ui 1.3.3 → 1.4.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 (137) hide show
  1. package/dist/assets/ui.css +1176 -766
  2. package/dist/chart.cjs +60 -24
  3. package/dist/chart.js +38 -24
  4. package/dist/colorpicker.cjs +56 -9
  5. package/dist/colorpicker.js +34 -9
  6. package/dist/components/Badge/Badge.module.scss.cjs +23 -16
  7. package/dist/components/Badge/Badge.module.scss.js +23 -16
  8. package/dist/components/Badge/index.cjs +8 -1
  9. package/dist/components/Badge/index.d.ts +3 -0
  10. package/dist/components/Badge/index.d.ts.map +1 -1
  11. package/dist/components/Badge/index.js +8 -1
  12. package/dist/components/Button/Button.module.scss.cjs +16 -13
  13. package/dist/components/Button/Button.module.scss.js +16 -13
  14. package/dist/components/Button/index.d.ts +2 -1
  15. package/dist/components/Button/index.d.ts.map +1 -1
  16. package/dist/components/Chart/index.d.ts +3 -0
  17. package/dist/components/Chart/index.d.ts.map +1 -1
  18. package/dist/components/CodeBlock/CodeBlock.module.scss.cjs +21 -21
  19. package/dist/components/CodeBlock/CodeBlock.module.scss.js +21 -21
  20. package/dist/components/ColorPicker/index.d.ts +4 -0
  21. package/dist/components/ColorPicker/index.d.ts.map +1 -1
  22. package/dist/components/Combobox/Combobox.module.scss.cjs +23 -23
  23. package/dist/components/Combobox/Combobox.module.scss.js +23 -23
  24. package/dist/components/Command/Command.module.scss.cjs +11 -11
  25. package/dist/components/Command/Command.module.scss.js +11 -11
  26. package/dist/components/ConversationList/ConversationList.module.scss.cjs +13 -10
  27. package/dist/components/ConversationList/ConversationList.module.scss.js +14 -11
  28. package/dist/components/ConversationList/index.cjs +26 -22
  29. package/dist/components/ConversationList/index.d.ts +5 -1
  30. package/dist/components/ConversationList/index.d.ts.map +1 -1
  31. package/dist/components/ConversationList/index.js +27 -23
  32. package/dist/components/DataTable/index.d.ts +4 -1
  33. package/dist/components/DataTable/index.d.ts.map +1 -1
  34. package/dist/components/DatePicker/index.d.ts +3 -0
  35. package/dist/components/DatePicker/index.d.ts.map +1 -1
  36. package/dist/components/Editor/index.d.ts +4 -1
  37. package/dist/components/Editor/index.d.ts.map +1 -1
  38. package/dist/components/Listbox/Listbox.module.scss.cjs +8 -8
  39. package/dist/components/Listbox/Listbox.module.scss.js +8 -8
  40. package/dist/components/Markdown/Markdown.module.scss.cjs +1 -1
  41. package/dist/components/Markdown/Markdown.module.scss.js +1 -1
  42. package/dist/components/Markdown/index.d.ts +16 -0
  43. package/dist/components/Markdown/index.d.ts.map +1 -1
  44. package/dist/components/Menu/Menu.module.scss.cjs +14 -14
  45. package/dist/components/Menu/Menu.module.scss.js +14 -14
  46. package/dist/components/Message/Message.module.scss.cjs +23 -20
  47. package/dist/components/Message/Message.module.scss.js +24 -21
  48. package/dist/components/Message/index.cjs +5 -1
  49. package/dist/components/Message/index.d.ts.map +1 -1
  50. package/dist/components/Message/index.js +5 -1
  51. package/dist/components/NavigationMenu/NavigationMenu.module.scss.cjs +28 -28
  52. package/dist/components/NavigationMenu/NavigationMenu.module.scss.js +28 -28
  53. package/dist/components/Pagination/Pagination.module.scss.cjs +7 -7
  54. package/dist/components/Pagination/Pagination.module.scss.js +7 -7
  55. package/dist/components/Prompt/Prompt.module.scss.cjs +52 -22
  56. package/dist/components/Prompt/Prompt.module.scss.js +52 -22
  57. package/dist/components/Prompt/index.cjs +197 -2
  58. package/dist/components/Prompt/index.d.ts +98 -3
  59. package/dist/components/Prompt/index.d.ts.map +1 -1
  60. package/dist/components/Prompt/index.js +198 -3
  61. package/dist/components/Select/Select.module.scss.cjs +29 -17
  62. package/dist/components/Select/Select.module.scss.js +30 -18
  63. package/dist/components/Select/index.cjs +45 -8
  64. package/dist/components/Select/index.d.ts +17 -2
  65. package/dist/components/Select/index.d.ts.map +1 -1
  66. package/dist/components/Select/index.js +45 -8
  67. package/dist/components/Sidebar/Sidebar.module.scss.cjs +45 -42
  68. package/dist/components/Sidebar/Sidebar.module.scss.js +45 -42
  69. package/dist/components/Sidebar/index.cjs +2 -0
  70. package/dist/components/Sidebar/index.d.ts +6 -1
  71. package/dist/components/Sidebar/index.d.ts.map +1 -1
  72. package/dist/components/Sidebar/index.js +2 -0
  73. package/dist/components/Text/Text.module.scss.cjs +63 -51
  74. package/dist/components/Text/Text.module.scss.js +63 -51
  75. package/dist/components/Text/index.d.ts +4 -2
  76. package/dist/components/Text/index.d.ts.map +1 -1
  77. package/dist/data-table.cjs +210 -28
  78. package/dist/data-table.js +189 -29
  79. package/dist/datepicker.cjs +63 -14
  80. package/dist/datepicker.js +41 -14
  81. package/dist/editor.cjs +67 -16
  82. package/dist/editor.js +45 -16
  83. package/dist/index.cjs +1 -0
  84. package/dist/index.d.ts +1 -1
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +2 -1
  87. package/dist/markdown.cjs +63 -19
  88. package/dist/markdown.js +41 -19
  89. package/fragments.json +1 -1
  90. package/package.json +2 -2
  91. package/src/components/Badge/Badge.contract.json +28 -5
  92. package/src/components/Badge/Badge.module.scss +21 -0
  93. package/src/components/Badge/index.tsx +10 -1
  94. package/src/components/Button/Button.contract.json +9 -3
  95. package/src/components/Button/Button.module.scss +34 -0
  96. package/src/components/Button/index.tsx +11 -1
  97. package/src/components/Chart/Chart.contract.json +7 -0
  98. package/src/components/Chart/index.tsx +44 -27
  99. package/src/components/CodeBlock/CodeBlock.contract.json +7 -0
  100. package/src/components/CodeBlock/CodeBlock.module.scss +7 -2
  101. package/src/components/ColorPicker/ColorPicker.contract.json +9 -1
  102. package/src/components/ColorPicker/index.tsx +42 -12
  103. package/src/components/Combobox/Combobox.module.scss +4 -13
  104. package/src/components/ConversationList/ConversationList.contract.json +16 -1
  105. package/src/components/ConversationList/ConversationList.module.scss +12 -0
  106. package/src/components/ConversationList/index.tsx +40 -26
  107. package/src/components/DataTable/DataTable.contract.json +8 -1
  108. package/src/components/DataTable/index.tsx +282 -51
  109. package/src/components/DatePicker/DatePicker.contract.json +8 -1
  110. package/src/components/DatePicker/index.tsx +51 -22
  111. package/src/components/Editor/Editor.contract.json +19 -1
  112. package/src/components/Editor/index.tsx +67 -23
  113. package/src/components/Listbox/Listbox.module.scss +3 -11
  114. package/src/components/Markdown/Markdown.contract.json +15 -1
  115. package/src/components/Markdown/Markdown.module.scss +18 -1
  116. package/src/components/Markdown/index.tsx +58 -24
  117. package/src/components/Menu/Menu.module.scss +12 -2
  118. package/src/components/Message/Message.contract.json +3 -0
  119. package/src/components/Message/Message.module.scss +33 -4
  120. package/src/components/Message/index.tsx +7 -1
  121. package/src/components/Pagination/Pagination.contract.json +1 -0
  122. package/src/components/Pagination/Pagination.module.scss +5 -4
  123. package/src/components/Prompt/Prompt.contract.json +40 -1
  124. package/src/components/Prompt/Prompt.module.scss +351 -4
  125. package/src/components/Prompt/index.tsx +324 -0
  126. package/src/components/Select/Select.contract.json +11 -1
  127. package/src/components/Select/Select.module.scss +80 -13
  128. package/src/components/Select/index.tsx +73 -7
  129. package/src/components/Sidebar/Sidebar.contract.json +1 -0
  130. package/src/components/Sidebar/Sidebar.module.scss +10 -0
  131. package/src/components/Sidebar/index.tsx +7 -0
  132. package/src/components/Text/Text.contract.json +7 -4
  133. package/src/components/Text/Text.module.scss +18 -0
  134. package/src/components/Text/index.tsx +4 -2
  135. package/src/index.ts +1 -0
  136. package/src/tokens/_mixins.scss +39 -4
  137. package/src/tokens/_variables.scss +30 -0
@@ -1,90 +1,102 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const text = "_text_4yy44_1";
4
- const variantSectionLabel = "_variant-section-label_4yy44_7";
5
- const size2Xs = "_size-2xs_4yy44_17";
6
- const sizeXs = "_size-xs_4yy44_21";
7
- const sizeSm = "_size-sm_4yy44_25";
8
- const sizeBase = "_size-base_4yy44_29";
9
- const sizeMd = "_size-md_4yy44_33";
10
- const sizeLg = "_size-lg_4yy44_37";
11
- const sizeXl = "_size-xl_4yy44_41";
12
- const size2Xl = "_size-2xl_4yy44_45";
13
- const size3Xl = "_size-3xl_4yy44_49";
14
- const size4Xl = "_size-4xl_4yy44_55";
15
- const weightNormal = "_weight-normal_4yy44_61";
16
- const weightMedium = "_weight-medium_4yy44_65";
17
- const weightSemibold = "_weight-semibold_4yy44_69";
18
- const weightBold = "_weight-bold_4yy44_73";
19
- const colorPrimary = "_color-primary_4yy44_77";
20
- const colorSecondary = "_color-secondary_4yy44_81";
21
- const colorTertiary = "_color-tertiary_4yy44_85";
22
- const colorMuted = "_color-muted_4yy44_86";
23
- const mono = "_mono_4yy44_90";
24
- const truncate = "_truncate_4yy44_94";
25
- const lineClamp = "_lineClamp_4yy44_100";
26
- const trackingNormal = "_tracking-normal_4yy44_108";
27
- const trackingTight = "_tracking-tight_4yy44_112";
28
- const trackingTighter = "_tracking-tighter_4yy44_116";
29
- const trackingTightest = "_tracking-tightest_4yy44_120";
30
- const tabularNums = "_tabularNums_4yy44_124";
3
+ const text = "_text_1159j_1";
4
+ const variantSectionLabel = "_variant-section-label_1159j_7";
5
+ const size2Xs = "_size-2xs_1159j_17";
6
+ const sizeXs = "_size-xs_1159j_21";
7
+ const sizeSm = "_size-sm_1159j_25";
8
+ const sizeBase = "_size-base_1159j_29";
9
+ const sizeMd = "_size-md_1159j_33";
10
+ const sizeLg = "_size-lg_1159j_37";
11
+ const sizeXl = "_size-xl_1159j_41";
12
+ const size2Xl = "_size-2xl_1159j_45";
13
+ const size3Xl = "_size-3xl_1159j_49";
14
+ const size4Xl = "_size-4xl_1159j_55";
15
+ const weightNormal = "_weight-normal_1159j_61";
16
+ const weightMedium = "_weight-medium_1159j_65";
17
+ const weightSemibold = "_weight-semibold_1159j_69";
18
+ const weightBold = "_weight-bold_1159j_73";
19
+ const colorPrimary = "_color-primary_1159j_77";
20
+ const colorSecondary = "_color-secondary_1159j_81";
21
+ const colorTertiary = "_color-tertiary_1159j_85";
22
+ const colorMuted = "_color-muted_1159j_86";
23
+ const colorSuccess = "_color-success_1159j_90";
24
+ const colorWarning = "_color-warning_1159j_94";
25
+ const colorDanger = "_color-danger_1159j_98";
26
+ const mono = "_mono_1159j_102";
27
+ const truncate = "_truncate_1159j_106";
28
+ const lineClamp = "_lineClamp_1159j_112";
29
+ const trackingNormal = "_tracking-normal_1159j_120";
30
+ const trackingTight = "_tracking-tight_1159j_124";
31
+ const trackingTighter = "_tracking-tighter_1159j_128";
32
+ const trackingTightest = "_tracking-tightest_1159j_132";
33
+ const tabularNums = "_tabularNums_1159j_136";
31
34
  const styles = {
32
35
  text,
33
- "variant-section-label": "_variant-section-label_4yy44_7",
36
+ "variant-section-label": "_variant-section-label_1159j_7",
34
37
  variantSectionLabel,
35
- "size-2xs": "_size-2xs_4yy44_17",
38
+ "size-2xs": "_size-2xs_1159j_17",
36
39
  size2Xs,
37
- "size-xs": "_size-xs_4yy44_21",
40
+ "size-xs": "_size-xs_1159j_21",
38
41
  sizeXs,
39
- "size-sm": "_size-sm_4yy44_25",
42
+ "size-sm": "_size-sm_1159j_25",
40
43
  sizeSm,
41
- "size-base": "_size-base_4yy44_29",
44
+ "size-base": "_size-base_1159j_29",
42
45
  sizeBase,
43
- "size-md": "_size-md_4yy44_33",
46
+ "size-md": "_size-md_1159j_33",
44
47
  sizeMd,
45
- "size-lg": "_size-lg_4yy44_37",
48
+ "size-lg": "_size-lg_1159j_37",
46
49
  sizeLg,
47
- "size-xl": "_size-xl_4yy44_41",
50
+ "size-xl": "_size-xl_1159j_41",
48
51
  sizeXl,
49
- "size-2xl": "_size-2xl_4yy44_45",
52
+ "size-2xl": "_size-2xl_1159j_45",
50
53
  size2Xl,
51
- "size-3xl": "_size-3xl_4yy44_49",
54
+ "size-3xl": "_size-3xl_1159j_49",
52
55
  size3Xl,
53
- "size-4xl": "_size-4xl_4yy44_55",
56
+ "size-4xl": "_size-4xl_1159j_55",
54
57
  size4Xl,
55
- "weight-normal": "_weight-normal_4yy44_61",
58
+ "weight-normal": "_weight-normal_1159j_61",
56
59
  weightNormal,
57
- "weight-medium": "_weight-medium_4yy44_65",
60
+ "weight-medium": "_weight-medium_1159j_65",
58
61
  weightMedium,
59
- "weight-semibold": "_weight-semibold_4yy44_69",
62
+ "weight-semibold": "_weight-semibold_1159j_69",
60
63
  weightSemibold,
61
- "weight-bold": "_weight-bold_4yy44_73",
64
+ "weight-bold": "_weight-bold_1159j_73",
62
65
  weightBold,
63
- "color-primary": "_color-primary_4yy44_77",
66
+ "color-primary": "_color-primary_1159j_77",
64
67
  colorPrimary,
65
- "color-secondary": "_color-secondary_4yy44_81",
68
+ "color-secondary": "_color-secondary_1159j_81",
66
69
  colorSecondary,
67
- "color-tertiary": "_color-tertiary_4yy44_85",
70
+ "color-tertiary": "_color-tertiary_1159j_85",
68
71
  colorTertiary,
69
- "color-muted": "_color-muted_4yy44_86",
72
+ "color-muted": "_color-muted_1159j_86",
70
73
  colorMuted,
74
+ "color-success": "_color-success_1159j_90",
75
+ colorSuccess,
76
+ "color-warning": "_color-warning_1159j_94",
77
+ colorWarning,
78
+ "color-danger": "_color-danger_1159j_98",
79
+ colorDanger,
71
80
  mono,
72
81
  truncate,
73
82
  lineClamp,
74
- "tracking-normal": "_tracking-normal_4yy44_108",
83
+ "tracking-normal": "_tracking-normal_1159j_120",
75
84
  trackingNormal,
76
- "tracking-tight": "_tracking-tight_4yy44_112",
85
+ "tracking-tight": "_tracking-tight_1159j_124",
77
86
  trackingTight,
78
- "tracking-tighter": "_tracking-tighter_4yy44_116",
87
+ "tracking-tighter": "_tracking-tighter_1159j_128",
79
88
  trackingTighter,
80
- "tracking-tightest": "_tracking-tightest_4yy44_120",
89
+ "tracking-tightest": "_tracking-tightest_1159j_132",
81
90
  trackingTightest,
82
91
  tabularNums
83
92
  };
93
+ exports.colorDanger = colorDanger;
84
94
  exports.colorMuted = colorMuted;
85
95
  exports.colorPrimary = colorPrimary;
86
96
  exports.colorSecondary = colorSecondary;
97
+ exports.colorSuccess = colorSuccess;
87
98
  exports.colorTertiary = colorTertiary;
99
+ exports.colorWarning = colorWarning;
88
100
  exports.default = styles;
89
101
  exports.lineClamp = lineClamp;
90
102
  exports.mono = mono;
@@ -1,89 +1,101 @@
1
- const text = "_text_4yy44_1";
2
- const variantSectionLabel = "_variant-section-label_4yy44_7";
3
- const size2Xs = "_size-2xs_4yy44_17";
4
- const sizeXs = "_size-xs_4yy44_21";
5
- const sizeSm = "_size-sm_4yy44_25";
6
- const sizeBase = "_size-base_4yy44_29";
7
- const sizeMd = "_size-md_4yy44_33";
8
- const sizeLg = "_size-lg_4yy44_37";
9
- const sizeXl = "_size-xl_4yy44_41";
10
- const size2Xl = "_size-2xl_4yy44_45";
11
- const size3Xl = "_size-3xl_4yy44_49";
12
- const size4Xl = "_size-4xl_4yy44_55";
13
- const weightNormal = "_weight-normal_4yy44_61";
14
- const weightMedium = "_weight-medium_4yy44_65";
15
- const weightSemibold = "_weight-semibold_4yy44_69";
16
- const weightBold = "_weight-bold_4yy44_73";
17
- const colorPrimary = "_color-primary_4yy44_77";
18
- const colorSecondary = "_color-secondary_4yy44_81";
19
- const colorTertiary = "_color-tertiary_4yy44_85";
20
- const colorMuted = "_color-muted_4yy44_86";
21
- const mono = "_mono_4yy44_90";
22
- const truncate = "_truncate_4yy44_94";
23
- const lineClamp = "_lineClamp_4yy44_100";
24
- const trackingNormal = "_tracking-normal_4yy44_108";
25
- const trackingTight = "_tracking-tight_4yy44_112";
26
- const trackingTighter = "_tracking-tighter_4yy44_116";
27
- const trackingTightest = "_tracking-tightest_4yy44_120";
28
- const tabularNums = "_tabularNums_4yy44_124";
1
+ const text = "_text_1159j_1";
2
+ const variantSectionLabel = "_variant-section-label_1159j_7";
3
+ const size2Xs = "_size-2xs_1159j_17";
4
+ const sizeXs = "_size-xs_1159j_21";
5
+ const sizeSm = "_size-sm_1159j_25";
6
+ const sizeBase = "_size-base_1159j_29";
7
+ const sizeMd = "_size-md_1159j_33";
8
+ const sizeLg = "_size-lg_1159j_37";
9
+ const sizeXl = "_size-xl_1159j_41";
10
+ const size2Xl = "_size-2xl_1159j_45";
11
+ const size3Xl = "_size-3xl_1159j_49";
12
+ const size4Xl = "_size-4xl_1159j_55";
13
+ const weightNormal = "_weight-normal_1159j_61";
14
+ const weightMedium = "_weight-medium_1159j_65";
15
+ const weightSemibold = "_weight-semibold_1159j_69";
16
+ const weightBold = "_weight-bold_1159j_73";
17
+ const colorPrimary = "_color-primary_1159j_77";
18
+ const colorSecondary = "_color-secondary_1159j_81";
19
+ const colorTertiary = "_color-tertiary_1159j_85";
20
+ const colorMuted = "_color-muted_1159j_86";
21
+ const colorSuccess = "_color-success_1159j_90";
22
+ const colorWarning = "_color-warning_1159j_94";
23
+ const colorDanger = "_color-danger_1159j_98";
24
+ const mono = "_mono_1159j_102";
25
+ const truncate = "_truncate_1159j_106";
26
+ const lineClamp = "_lineClamp_1159j_112";
27
+ const trackingNormal = "_tracking-normal_1159j_120";
28
+ const trackingTight = "_tracking-tight_1159j_124";
29
+ const trackingTighter = "_tracking-tighter_1159j_128";
30
+ const trackingTightest = "_tracking-tightest_1159j_132";
31
+ const tabularNums = "_tabularNums_1159j_136";
29
32
  const styles = {
30
33
  text,
31
- "variant-section-label": "_variant-section-label_4yy44_7",
34
+ "variant-section-label": "_variant-section-label_1159j_7",
32
35
  variantSectionLabel,
33
- "size-2xs": "_size-2xs_4yy44_17",
36
+ "size-2xs": "_size-2xs_1159j_17",
34
37
  size2Xs,
35
- "size-xs": "_size-xs_4yy44_21",
38
+ "size-xs": "_size-xs_1159j_21",
36
39
  sizeXs,
37
- "size-sm": "_size-sm_4yy44_25",
40
+ "size-sm": "_size-sm_1159j_25",
38
41
  sizeSm,
39
- "size-base": "_size-base_4yy44_29",
42
+ "size-base": "_size-base_1159j_29",
40
43
  sizeBase,
41
- "size-md": "_size-md_4yy44_33",
44
+ "size-md": "_size-md_1159j_33",
42
45
  sizeMd,
43
- "size-lg": "_size-lg_4yy44_37",
46
+ "size-lg": "_size-lg_1159j_37",
44
47
  sizeLg,
45
- "size-xl": "_size-xl_4yy44_41",
48
+ "size-xl": "_size-xl_1159j_41",
46
49
  sizeXl,
47
- "size-2xl": "_size-2xl_4yy44_45",
50
+ "size-2xl": "_size-2xl_1159j_45",
48
51
  size2Xl,
49
- "size-3xl": "_size-3xl_4yy44_49",
52
+ "size-3xl": "_size-3xl_1159j_49",
50
53
  size3Xl,
51
- "size-4xl": "_size-4xl_4yy44_55",
54
+ "size-4xl": "_size-4xl_1159j_55",
52
55
  size4Xl,
53
- "weight-normal": "_weight-normal_4yy44_61",
56
+ "weight-normal": "_weight-normal_1159j_61",
54
57
  weightNormal,
55
- "weight-medium": "_weight-medium_4yy44_65",
58
+ "weight-medium": "_weight-medium_1159j_65",
56
59
  weightMedium,
57
- "weight-semibold": "_weight-semibold_4yy44_69",
60
+ "weight-semibold": "_weight-semibold_1159j_69",
58
61
  weightSemibold,
59
- "weight-bold": "_weight-bold_4yy44_73",
62
+ "weight-bold": "_weight-bold_1159j_73",
60
63
  weightBold,
61
- "color-primary": "_color-primary_4yy44_77",
64
+ "color-primary": "_color-primary_1159j_77",
62
65
  colorPrimary,
63
- "color-secondary": "_color-secondary_4yy44_81",
66
+ "color-secondary": "_color-secondary_1159j_81",
64
67
  colorSecondary,
65
- "color-tertiary": "_color-tertiary_4yy44_85",
68
+ "color-tertiary": "_color-tertiary_1159j_85",
66
69
  colorTertiary,
67
- "color-muted": "_color-muted_4yy44_86",
70
+ "color-muted": "_color-muted_1159j_86",
68
71
  colorMuted,
72
+ "color-success": "_color-success_1159j_90",
73
+ colorSuccess,
74
+ "color-warning": "_color-warning_1159j_94",
75
+ colorWarning,
76
+ "color-danger": "_color-danger_1159j_98",
77
+ colorDanger,
69
78
  mono,
70
79
  truncate,
71
80
  lineClamp,
72
- "tracking-normal": "_tracking-normal_4yy44_108",
81
+ "tracking-normal": "_tracking-normal_1159j_120",
73
82
  trackingNormal,
74
- "tracking-tight": "_tracking-tight_4yy44_112",
83
+ "tracking-tight": "_tracking-tight_1159j_124",
75
84
  trackingTight,
76
- "tracking-tighter": "_tracking-tighter_4yy44_116",
85
+ "tracking-tighter": "_tracking-tighter_1159j_128",
77
86
  trackingTighter,
78
- "tracking-tightest": "_tracking-tightest_4yy44_120",
87
+ "tracking-tightest": "_tracking-tightest_1159j_132",
79
88
  trackingTightest,
80
89
  tabularNums
81
90
  };
82
91
  export {
92
+ colorDanger,
83
93
  colorMuted,
84
94
  colorPrimary,
85
95
  colorSecondary,
96
+ colorSuccess,
86
97
  colorTertiary,
98
+ colorWarning,
87
99
  styles as default,
88
100
  lineClamp,
89
101
  mono,
@@ -17,9 +17,11 @@ export interface TextProps extends Omit<React.HTMLAttributes<HTMLElement>, 'colo
17
17
  /** Font weight.
18
18
  * @default "normal" */
19
19
  weight?: 'normal' | 'medium' | 'semibold' | 'bold';
20
- /** Text color. `"muted"` is an alias for `"tertiary"`.
20
+ /** Text color. `"muted"` is an alias for `"tertiary"`. `"success" | "warning" | "danger"`
21
+ * are for a run of text that carries a state on its own; prefer Badge or Alert when the
22
+ * state deserves a container.
21
23
  * @default "primary" */
22
- color?: 'primary' | 'secondary' | 'tertiary' | 'muted';
24
+ color?: 'primary' | 'secondary' | 'tertiary' | 'muted' | 'success' | 'warning' | 'danger';
23
25
  /** Font family.
24
26
  * @default "sans" */
25
27
  font?: 'sans' | 'mono';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACjF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;yBACqB;IACrB,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAA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 var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
3
25
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
26
  const jsxRuntime = require("react/jsx-runtime");
5
27
  const React = require("react");
@@ -25,16 +47,38 @@ function _interopNamespaceDefault(e) {
25
47
  }
26
48
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
27
49
  let _reactTable = null;
28
- let _reactTableLoaded = false;
50
+ let _reactTableLoadPromise = null;
29
51
  let _reactTableFailed = false;
30
52
  function loadReactTable() {
31
- if (_reactTableLoaded) return;
32
- _reactTableLoaded = true;
33
- try {
34
- _reactTable = require("@tanstack/react-table");
35
- } catch {
36
- _reactTableFailed = true;
53
+ if (!_reactTableLoadPromise) {
54
+ _reactTableLoadPromise = (async () => {
55
+ try {
56
+ _reactTable = await import("@tanstack/react-table");
57
+ } catch {
58
+ _reactTableFailed = true;
59
+ if (process.env.NODE_ENV === "development") {
60
+ console.warn(
61
+ "[@usefragments/ui] DataTable: @tanstack/react-table is not installed. Rendering a static table without sorting, selection, or expansion. Install it with: npm install @tanstack/react-table"
62
+ );
63
+ }
64
+ }
65
+ })();
37
66
  }
67
+ return _reactTableLoadPromise;
68
+ }
69
+ function useReactTableDeps() {
70
+ const [, rerender] = React__namespace.useReducer((n) => n + 1, 0);
71
+ React__namespace.useEffect(() => {
72
+ if (_reactTable || _reactTableFailed) return;
73
+ let active = true;
74
+ void loadReactTable().then(() => {
75
+ if (active) rerender();
76
+ });
77
+ return () => {
78
+ active = false;
79
+ };
80
+ }, []);
81
+ return _reactTable ? "ready" : _reactTableFailed ? "failed" : "pending";
38
82
  }
39
83
  function getColumnSizeStyle(column) {
40
84
  const { size, minSize, maxSize } = column.columnDef;
@@ -49,6 +93,24 @@ function getColumnSizeStyle(column) {
49
93
  maxWidth: maxSize ?? resolvedSize
50
94
  };
51
95
  }
96
+ function computeTableClasses(opts) {
97
+ const densityClass = opts.density === "condensed" ? DataTable_module.default.densityCondensed : opts.density === "regular" ? DataTable_module.default.densityRegular : opts.density === "relaxed" ? DataTable_module.default.densityRelaxed : void 0;
98
+ const rootClasses = [
99
+ DataTable_module.default.table,
100
+ opts.hasExplicitColumnSizing && DataTable_module.default.fixedLayout,
101
+ DataTable_module.default[opts.size],
102
+ densityClass,
103
+ opts.striped && DataTable_module.default.striped,
104
+ opts.className
105
+ ].filter(Boolean).join(" ");
106
+ const wrapperClasses = [
107
+ DataTable_module.default.wrapper,
108
+ opts.bordered && DataTable_module.default.bordered,
109
+ opts.wrapperClassName,
110
+ opts.wrapperPropsClassName
111
+ ].filter(Boolean).join(" ");
112
+ return { rootClasses, wrapperClasses };
113
+ }
52
114
  function isInteractiveTarget(target, currentTarget) {
53
115
  if (!(target instanceof Element)) return false;
54
116
  const interactiveElement = target.closest(
@@ -58,7 +120,7 @@ function isInteractiveTarget(target, currentTarget) {
58
120
  interactiveElement && interactiveElement !== currentTarget && currentTarget.contains(interactiveElement)
59
121
  );
60
122
  }
61
- function DataTableRoot({
123
+ function DataTableLive({
62
124
  columns: userColumns,
63
125
  data,
64
126
  getRowId,
@@ -92,12 +154,6 @@ function DataTableRoot({
92
154
  "aria-describedby": ariaDescribedBy,
93
155
  ...htmlProps
94
156
  }) {
95
- loadReactTable();
96
- if (_reactTableFailed || !_reactTable) {
97
- throw new Error(
98
- "[@usefragments/ui] DataTable: @tanstack/react-table is not installed. Install it with: npm install @tanstack/react-table"
99
- );
100
- }
101
157
  const { flexRender, getCoreRowModel, getExpandedRowModel, getSortedRowModel, useReactTable } = _reactTable;
102
158
  const tableRef = React__namespace.useRef(null);
103
159
  DataTable_support.useArrowKeyRowNav(tableRef, !!onRowClick);
@@ -169,22 +225,17 @@ function DataTableRoot({
169
225
  enableExpanding: hasSubRows
170
226
  });
171
227
  const isEmpty = !loading && data.length === 0;
172
- const densityClass = density === "condensed" ? DataTable_module.default.densityCondensed : density === "regular" ? DataTable_module.default.densityRegular : density === "relaxed" ? DataTable_module.default.densityRelaxed : void 0;
173
- const rootClasses = [
174
- DataTable_module.default.table,
175
- hasExplicitColumnSizing && DataTable_module.default.fixedLayout,
176
- DataTable_module.default[size],
177
- densityClass,
178
- striped && DataTable_module.default.striped,
179
- className
180
- ].filter(Boolean).join(" ");
181
228
  const { className: wrapperPropsClassName, ...restWrapperProps } = wrapperProps ?? {};
182
- const wrapperClasses = [
183
- DataTable_module.default.wrapper,
184
- bordered && DataTable_module.default.bordered,
229
+ const { rootClasses, wrapperClasses } = computeTableClasses({
230
+ size,
231
+ density,
232
+ striped,
233
+ bordered,
234
+ hasExplicitColumnSizing,
235
+ className,
185
236
  wrapperClassName,
186
237
  wrapperPropsClassName
187
- ].filter(Boolean).join(" ");
238
+ });
188
239
  if (isEmpty) {
189
240
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ...restWrapperProps, className: wrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsxs(
190
241
  "table",
@@ -327,6 +378,135 @@ function DataTableRoot({
327
378
  }
328
379
  ) });
329
380
  }
381
+ function staticColumnSizeStyle(col) {
382
+ const { size, minSize, maxSize } = col;
383
+ if (size === void 0 && minSize === void 0 && maxSize === void 0) return void 0;
384
+ const resolved = size ?? minSize ?? maxSize;
385
+ return { width: resolved, minWidth: minSize ?? resolved, maxWidth: maxSize ?? resolved };
386
+ }
387
+ function staticCellContent(col, row, index2) {
388
+ const raw = col.accessorFn ? col.accessorFn(row) : col.accessorKey ? row[col.accessorKey] : void 0;
389
+ if (typeof col.cell === "function") {
390
+ try {
391
+ return col.cell({
392
+ row: { original: row, id: String(index2), index: index2, depth: 0 },
393
+ getValue: () => raw,
394
+ column: { id: col.id ?? col.accessorKey ?? "" }
395
+ });
396
+ } catch {
397
+ }
398
+ }
399
+ return typeof raw === "string" || typeof raw === "number" ? raw : null;
400
+ }
401
+ function DataTableStatic({
402
+ pending,
403
+ columns,
404
+ data,
405
+ getRowId,
406
+ emptyMessage = "No data available",
407
+ emptyState,
408
+ loading = false,
409
+ skeletonRows = 6,
410
+ density,
411
+ hideHeader = false,
412
+ size = "md",
413
+ className,
414
+ caption,
415
+ captionHidden = false,
416
+ striped = false,
417
+ bordered = false,
418
+ wrapperClassName,
419
+ wrapperProps,
420
+ "aria-label": ariaLabel,
421
+ "aria-describedby": ariaDescribedBy,
422
+ // Interactive props are inert without the peer — accepted but unused.
423
+ sortable: _sortable,
424
+ sorting: _sorting,
425
+ onSortingChange: _onSortingChange,
426
+ selectable: _selectable,
427
+ showCheckbox: _showCheckbox,
428
+ rowSelection: _rowSelection,
429
+ onRowSelectionChange: _onRowSelectionChange,
430
+ onRowClick: _onRowClick,
431
+ getRowProps: _getRowProps,
432
+ getSubRows: _getSubRows,
433
+ expanded: _expanded,
434
+ onExpandedChange: _onExpandedChange,
435
+ ...htmlProps
436
+ }) {
437
+ const hasExplicitColumnSizing = columns.some(
438
+ (column) => column.size !== void 0 || column.minSize !== void 0 || column.maxSize !== void 0
439
+ );
440
+ const { className: wrapperPropsClassName, ...restWrapperProps } = wrapperProps ?? {};
441
+ const { rootClasses, wrapperClasses } = computeTableClasses({
442
+ size,
443
+ density,
444
+ striped,
445
+ bordered,
446
+ hasExplicitColumnSizing,
447
+ className,
448
+ wrapperClassName,
449
+ wrapperPropsClassName
450
+ });
451
+ const showSkeleton = pending || loading;
452
+ const isEmpty = !showSkeleton && data.length === 0;
453
+ const columnCount = Math.max(columns.length, 1);
454
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...restWrapperProps, className: wrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsxs(
455
+ "table",
456
+ {
457
+ ...htmlProps,
458
+ className: rootClasses,
459
+ "aria-label": ariaLabel,
460
+ "aria-describedby": ariaDescribedBy,
461
+ "aria-busy": showSkeleton || void 0,
462
+ children: [
463
+ caption && /* @__PURE__ */ jsxRuntime.jsx("caption", { className: captionHidden ? DataTable_module.default.captionHidden : DataTable_module.default.caption, children: caption }),
464
+ !hideHeader && !isEmpty && /* @__PURE__ */ jsxRuntime.jsx("thead", { className: DataTable_module.default.thead, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: DataTable_module.default.headerRow, children: columns.map((col, colIndex) => /* @__PURE__ */ jsxRuntime.jsx(
465
+ "th",
466
+ {
467
+ className: DataTable_module.default.th,
468
+ style: staticColumnSizeStyle(col),
469
+ scope: "col",
470
+ "data-align": col.align,
471
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: DataTable_module.default.headerContent, children: typeof col.header === "string" ? col.header : col.id ?? col.accessorKey ?? "" })
472
+ },
473
+ col.id ?? col.accessorKey ?? colIndex
474
+ )) }) }),
475
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: DataTable_module.default.tbody, children: showSkeleton ? /* @__PURE__ */ jsxRuntime.jsx(
476
+ DataTable_support.DataTableSkeletonRows,
477
+ {
478
+ rowCount: skeletonRows,
479
+ columnCount,
480
+ rowClassName: DataTable_module.default.row,
481
+ cellClassName: DataTable_module.default.td,
482
+ barClassName: DataTable_module.default.skeletonBar
483
+ }
484
+ ) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: DataTable_module.default.row, children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: DataTable_module.default.td, colSpan: columnCount, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: DataTable_module.default.emptyState, children: emptyState ?? /* @__PURE__ */ jsxRuntime.jsx("span", { className: DataTable_module.default.emptyMessage, children: emptyMessage }) }) }) }) : data.map((row, rowIndex) => {
485
+ const rowKey = (getRowId == null ? void 0 : getRowId(row)) ?? rowIndex;
486
+ return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: DataTable_module.default.row, children: columns.map((col, colIndex) => {
487
+ const content = staticCellContent(col, row, rowIndex);
488
+ return /* @__PURE__ */ jsxRuntime.jsx(
489
+ "td",
490
+ {
491
+ className: [DataTable_module.default.td, col.truncate && DataTable_module.default.truncate].filter(Boolean).join(" "),
492
+ "data-align": col.align,
493
+ title: typeof content === "string" ? content : void 0,
494
+ style: staticColumnSizeStyle(col),
495
+ children: content
496
+ },
497
+ col.id ?? col.accessorKey ?? colIndex
498
+ );
499
+ }) }, rowKey);
500
+ }) })
501
+ ]
502
+ }
503
+ ) });
504
+ }
505
+ function DataTableRoot(props) {
506
+ const deps = useReactTableDeps();
507
+ if (deps === "ready") return /* @__PURE__ */ jsxRuntime.jsx(DataTableLive, { ...props });
508
+ return /* @__PURE__ */ jsxRuntime.jsx(DataTableStatic, { ...props, pending: deps === "pending" });
509
+ }
330
510
  function createColumns(columns) {
331
511
  return columns.map((col) => ({
332
512
  id: col.key,
@@ -340,7 +520,9 @@ function createColumns(columns) {
340
520
  }
341
521
  const DataTable = Object.assign(DataTableRoot, {
342
522
  Root: DataTableRoot,
343
- Columns: createColumns
523
+ Columns: createColumns,
524
+ /** Start resolving @tanstack/react-table before first render (optional). */
525
+ preload: loadReactTable
344
526
  });
345
527
  exports.DataTable = DataTable;
346
528
  exports.createColumns = createColumns;