@janbox/storefront-ui 1.0.0 → 1.0.2

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 (238) hide show
  1. package/dist/hooks/index.d.ts +2 -0
  2. package/dist/hooks/index.d.ts.map +1 -1
  3. package/dist/hooks/index.js +4 -0
  4. package/dist/hooks/use-controllable-state.js +2 -2
  5. package/dist/hooks/use-countdown-timer.js +1 -1
  6. package/dist/hooks/use-first-mount-state/index.d.ts +2 -0
  7. package/dist/hooks/use-first-mount-state/index.d.ts.map +1 -0
  8. package/dist/hooks/use-first-mount-state/index.js +12 -0
  9. package/dist/hooks/use-update-effect/index.d.ts +3 -0
  10. package/dist/hooks/use-update-effect/index.d.ts.map +1 -0
  11. package/dist/hooks/use-update-effect/index.js +13 -0
  12. package/dist/lib/accordion/accordion/accordion.d.ts +2 -1
  13. package/dist/lib/accordion/accordion/accordion.d.ts.map +1 -1
  14. package/dist/lib/accordion/accordion/accordion.js +15 -6
  15. package/dist/lib/accordion/accordion/types.d.ts +2 -2
  16. package/dist/lib/accordion/accordion/types.d.ts.map +1 -1
  17. package/dist/lib/date-picker/date-picker.d.ts.map +1 -1
  18. package/dist/lib/date-picker/date-picker.js +1 -2
  19. package/dist/lib/input-range/index.d.ts +1 -0
  20. package/dist/lib/input-range/index.d.ts.map +1 -1
  21. package/dist/lib/input-range/types.d.ts +3 -4
  22. package/dist/lib/input-range/types.d.ts.map +1 -1
  23. package/dist/node_modules/.pnpm/react-use@17.6.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-use/esm/misc/isDeepEqual.js +5 -0
  24. package/dist/node_modules/.pnpm/react-use@17.6.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-use/esm/useCustomCompareEffect.js +25 -0
  25. package/dist/node_modules/.pnpm/react-use@17.6.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-use/esm/useDeepCompareEffect.js +19 -0
  26. package/dist/node_modules/.pnpm/react-use@17.6.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-use/esm/useFirstMountState.js +12 -0
  27. package/dist/node_modules/.pnpm/react-use@17.6.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-use/esm/useUpdateEffect.js +13 -0
  28. package/dist/style.css +579 -0
  29. package/package.json +1 -14
  30. package/dist/HOCs/index.cjs +0 -4
  31. package/dist/HOCs/with-query-fallback.cjs +0 -16
  32. package/dist/assets/json/countries.json.cjs +0 -1159
  33. package/dist/assets/svg/arrow-down.svg.cjs +0 -3
  34. package/dist/assets/svg/arrow-forward.svg.cjs +0 -3
  35. package/dist/assets/svg/arrow-left.svg.cjs +0 -3
  36. package/dist/assets/svg/arrow-right.svg.cjs +0 -3
  37. package/dist/assets/svg/calendar.svg.cjs +0 -3
  38. package/dist/assets/svg/check.svg.cjs +0 -3
  39. package/dist/assets/svg/clock-time.svg.cjs +0 -3
  40. package/dist/assets/svg/done-check.svg.cjs +0 -3
  41. package/dist/assets/svg/earth-home-world.svg.cjs +0 -3
  42. package/dist/assets/svg/eye-hidden.svg.cjs +0 -3
  43. package/dist/assets/svg/eye-show-visible.svg.cjs +0 -3
  44. package/dist/assets/svg/image-placeholder.svg.cjs +0 -3
  45. package/dist/assets/svg/loading-waiting.svg.cjs +0 -3
  46. package/dist/assets/svg/long-arrow-right.svg.cjs +0 -3
  47. package/dist/assets/svg/minus.svg.cjs +0 -3
  48. package/dist/assets/svg/plus.svg.cjs +0 -3
  49. package/dist/assets/svg/search-add-plus-middle.svg.cjs +0 -3
  50. package/dist/assets/svg/search-minus.svg.cjs +0 -3
  51. package/dist/assets/svg/times-close-delete.svg.cjs +0 -3
  52. package/dist/components/index.cjs +0 -8
  53. package/dist/components/scroll-view.cjs +0 -19
  54. package/dist/components/svg-loader.cjs +0 -14
  55. package/dist/components/virtualized-list.cjs +0 -43
  56. package/dist/constants/index.cjs +0 -32
  57. package/dist/hooks/index.cjs +0 -14
  58. package/dist/hooks/use-controllable-state.cjs +0 -39
  59. package/dist/hooks/use-countdown-timer.cjs +0 -85
  60. package/dist/hooks/use-hover-line-effect/index.cjs +0 -24
  61. package/dist/hooks/use-hover-line-effect/use-hover-line-effect.module.scss.cjs +0 -8
  62. package/dist/hooks/use-query-params.cjs +0 -53
  63. package/dist/hooks/use-ripple-effect/index.cjs +0 -69
  64. package/dist/hooks/use-ripple-effect/use-ripple-effect.module.scss.cjs +0 -11
  65. package/dist/hooks/use-window-screen/index.cjs +0 -52
  66. package/dist/index.cjs +0 -305
  67. package/dist/lib/accordion/accordion/accordion.cjs +0 -109
  68. package/dist/lib/accordion/accordion/helpers.cjs +0 -21
  69. package/dist/lib/accordion/accordion/types.cjs +0 -7
  70. package/dist/lib/accordion/accordion-content/accordion-content.cjs +0 -41
  71. package/dist/lib/accordion/accordion-content/helpers.cjs +0 -8
  72. package/dist/lib/accordion/accordion-group/accordion-group.cjs +0 -56
  73. package/dist/lib/accordion/accordion-group/helpers.cjs +0 -20
  74. package/dist/lib/accordion/accordion-group/types.cjs +0 -7
  75. package/dist/lib/accordion/accordion-summary/accordion-summary.cjs +0 -64
  76. package/dist/lib/accordion/accordion-summary/helpers.cjs +0 -15
  77. package/dist/lib/accordion/accordion-summary/types.cjs +0 -8
  78. package/dist/lib/badge/badge.cjs +0 -42
  79. package/dist/lib/badge/helpers.cjs +0 -8
  80. package/dist/lib/box/box.cjs +0 -55
  81. package/dist/lib/box/helpers.cjs +0 -8
  82. package/dist/lib/breadcrumbs/breadcrumb-item/breadcrumb-item.cjs +0 -28
  83. package/dist/lib/breadcrumbs/breadcrumbs/breadcrumbs.cjs +0 -44
  84. package/dist/lib/button/button.cjs +0 -235
  85. package/dist/lib/button/helpers.cjs +0 -74
  86. package/dist/lib/cascader/cascader.cjs +0 -497
  87. package/dist/lib/cascader/helpers.cjs +0 -28
  88. package/dist/lib/checkbox/checkbox.cjs +0 -52
  89. package/dist/lib/checkbox/checkbox.module.scss.cjs +0 -23
  90. package/dist/lib/chip/chip.cjs +0 -60
  91. package/dist/lib/chip/helpers.cjs +0 -14
  92. package/dist/lib/collapse/collapse.cjs +0 -50
  93. package/dist/lib/container/container.cjs +0 -101
  94. package/dist/lib/container/helpers.cjs +0 -12
  95. package/dist/lib/count-up/count-up.cjs +0 -38
  96. package/dist/lib/countdown-timer/countdown-timer.cjs +0 -9
  97. package/dist/lib/date-picker/date-picker.cjs +0 -169
  98. package/dist/lib/date-picker/helpers.cjs +0 -12
  99. package/dist/lib/dialog/dialog/dialog.cjs +0 -93
  100. package/dist/lib/dialog/dialog/helpers.cjs +0 -27
  101. package/dist/lib/dialog/dialog-body/dialog-body.cjs +0 -32
  102. package/dist/lib/dialog/dialog-close/dialog-close.cjs +0 -5
  103. package/dist/lib/dialog/dialog-footer/dialog-footer.cjs +0 -31
  104. package/dist/lib/dialog/dialog-header/dialog-header.cjs +0 -73
  105. package/dist/lib/drawer/drawer/drawer.cjs +0 -100
  106. package/dist/lib/drawer/drawer/helpers.cjs +0 -7
  107. package/dist/lib/drawer/drawer-close/drawer-close.cjs +0 -5
  108. package/dist/lib/filter-panel/checkbox-filter-panel.cjs +0 -107
  109. package/dist/lib/filter-panel/filter-panel.cjs +0 -37
  110. package/dist/lib/filter-panel/input-range-filter-panel.cjs +0 -78
  111. package/dist/lib/filter-panel/input-text-filter-panel.cjs +0 -57
  112. package/dist/lib/filter-panel/radio-filter-panel.cjs +0 -95
  113. package/dist/lib/flag/flag.cjs +0 -20
  114. package/dist/lib/flag/helpers.cjs +0 -16
  115. package/dist/lib/flexbox/flex-item/flex-item.cjs +0 -22
  116. package/dist/lib/flexbox/flex-item/helpers.cjs +0 -10
  117. package/dist/lib/flexbox/flexbox/flexbox.cjs +0 -46
  118. package/dist/lib/flexbox/flexbox/helpers.cjs +0 -16
  119. package/dist/lib/floating/floating/floating.cjs +0 -97
  120. package/dist/lib/floating/floating/helpers.cjs +0 -9
  121. package/dist/lib/floating/floating-close/floating-close.cjs +0 -32
  122. package/dist/lib/floating/floating-content/floating-content.cjs +0 -57
  123. package/dist/lib/floating/floating-trigger/floating-trigger.cjs +0 -35
  124. package/dist/lib/form-helper-text/form-helper-text.cjs +0 -35
  125. package/dist/lib/form-label/form-label.cjs +0 -28
  126. package/dist/lib/generic-element/generic-element.cjs +0 -15
  127. package/dist/lib/grid/cell/cell.cjs +0 -28
  128. package/dist/lib/grid/cell/helpers.cjs +0 -8
  129. package/dist/lib/grid/grid/grid.cjs +0 -53
  130. package/dist/lib/grid/grid/helpers.cjs +0 -12
  131. package/dist/lib/highlight-words/highlight-words.cjs +0 -18
  132. package/dist/lib/icon/helpers.cjs +0 -12
  133. package/dist/lib/icon/icon.cjs +0 -38
  134. package/dist/lib/icon-button/helpers.cjs +0 -42
  135. package/dist/lib/icon-button/icon-button.cjs +0 -146
  136. package/dist/lib/image/helpers.cjs +0 -15
  137. package/dist/lib/image/image.cjs +0 -36
  138. package/dist/lib/input/helpers.cjs +0 -38
  139. package/dist/lib/input/input.cjs +0 -205
  140. package/dist/lib/input/input.module.scss.cjs +0 -17
  141. package/dist/lib/input-mask/helpers.cjs +0 -12
  142. package/dist/lib/input-mask/input-mask.cjs +0 -120
  143. package/dist/lib/input-number/input-number.cjs +0 -132
  144. package/dist/lib/input-number/input-number.module.scss.cjs +0 -8
  145. package/dist/lib/input-range/helpers.cjs +0 -12
  146. package/dist/lib/input-range/input-range.cjs +0 -179
  147. package/dist/lib/input-range/input-range.module.scss.cjs +0 -8
  148. package/dist/lib/lightbox/lightbox.cjs +0 -199
  149. package/dist/lib/linear-progress/helpers.cjs +0 -13
  150. package/dist/lib/linear-progress/linear-progress.cjs +0 -75
  151. package/dist/lib/link/helpers.cjs +0 -8
  152. package/dist/lib/link/link.cjs +0 -63
  153. package/dist/lib/loading/block-skeleton/block-skeleton.cjs +0 -21
  154. package/dist/lib/loading/image-skeleton/image-skeleton.cjs +0 -43
  155. package/dist/lib/loading/loading-overlay/loading-overlay.cjs +0 -60
  156. package/dist/lib/loading/text-skeleton/text-skeleton.cjs +0 -16
  157. package/dist/lib/marquee/marquee/helpers.cjs +0 -15
  158. package/dist/lib/marquee/marquee/marquee.cjs +0 -99
  159. package/dist/lib/marquee/marquee/types.cjs +0 -7
  160. package/dist/lib/marquee/marquee-item/marquee-item.cjs +0 -16
  161. package/dist/lib/menu/menu/menu.cjs +0 -38
  162. package/dist/lib/menu/menu-item/helpers.cjs +0 -16
  163. package/dist/lib/menu/menu-item/menu-item.cjs +0 -34
  164. package/dist/lib/menu/menu-list/menu-list.cjs +0 -34
  165. package/dist/lib/menu/menu-list/types.cjs +0 -7
  166. package/dist/lib/menu/menu-trigger/menu-trigger.cjs +0 -8
  167. package/dist/lib/multiple-select/helpers.cjs +0 -12
  168. package/dist/lib/multiple-select/multiple-select.cjs +0 -348
  169. package/dist/lib/nav-link/nav-link.cjs +0 -40
  170. package/dist/lib/notifications/helpers.cjs +0 -39
  171. package/dist/lib/notifications/notifications.cjs +0 -167
  172. package/dist/lib/otp-input/otp-input.cjs +0 -132
  173. package/dist/lib/pagination/helpers.cjs +0 -57
  174. package/dist/lib/pagination/pagination.cjs +0 -163
  175. package/dist/lib/phone-input/phone-input.cjs +0 -182
  176. package/dist/lib/popover/popover/helpers.cjs +0 -7
  177. package/dist/lib/popover/popover/popover.cjs +0 -31
  178. package/dist/lib/popover/popover-close/popover-close.cjs +0 -5
  179. package/dist/lib/popover/popover-content/popover-content.cjs +0 -29
  180. package/dist/lib/popover/popover-trigger/popover-trigger.cjs +0 -8
  181. package/dist/lib/primitive/primitive.cjs +0 -30
  182. package/dist/lib/progress/progress.cjs +0 -50
  183. package/dist/lib/radio-button/helpers.cjs +0 -8
  184. package/dist/lib/radio-button/radio-button.cjs +0 -33
  185. package/dist/lib/radio-button/radio-button.module.scss.cjs +0 -17
  186. package/dist/lib/select/helpers.cjs +0 -12
  187. package/dist/lib/select/select.cjs +0 -317
  188. package/dist/lib/star-rating/star-rating.cjs +0 -39
  189. package/dist/lib/stepper/step.cjs +0 -69
  190. package/dist/lib/stepper/stepper.cjs +0 -86
  191. package/dist/lib/stepper/types.cjs +0 -8
  192. package/dist/lib/swiper/swiper/helpers.cjs +0 -16
  193. package/dist/lib/swiper/swiper/swiper.cjs +0 -113
  194. package/dist/lib/swiper/swiper-dots-paging/swiper-dots-paging.cjs +0 -77
  195. package/dist/lib/swiper/swiper-slide/swiper-slide.cjs +0 -31
  196. package/dist/lib/switch/switch.cjs +0 -19
  197. package/dist/lib/switch/switch.module.scss.cjs +0 -14
  198. package/dist/lib/table/table/table.cjs +0 -26
  199. package/dist/lib/table/table-body/table-body.cjs +0 -34
  200. package/dist/lib/table/table-cell/table-cell.cjs +0 -12
  201. package/dist/lib/table/table-footer/table-footer.cjs +0 -7
  202. package/dist/lib/table/table-head/table-head.cjs +0 -33
  203. package/dist/lib/table/table-row/table-row.cjs +0 -7
  204. package/dist/lib/tabs/tab/helpers.cjs +0 -9
  205. package/dist/lib/tabs/tab/tab.cjs +0 -26
  206. package/dist/lib/tabs/tab-content/tab-content.cjs +0 -22
  207. package/dist/lib/tabs/tab-indicator/tab-indicator.cjs +0 -92
  208. package/dist/lib/tabs/tab-list/helpers.cjs +0 -8
  209. package/dist/lib/tabs/tab-list/tab-list.cjs +0 -40
  210. package/dist/lib/tabs/tab-panel/helpers.cjs +0 -8
  211. package/dist/lib/tabs/tab-panel/tab-panel.cjs +0 -21
  212. package/dist/lib/tabs/tabs/helpers.cjs +0 -36
  213. package/dist/lib/tabs/tabs/tabs.cjs +0 -62
  214. package/dist/lib/text/helpers.cjs +0 -140
  215. package/dist/lib/text/text.cjs +0 -41
  216. package/dist/lib/textarea/helpers.cjs +0 -12
  217. package/dist/lib/textarea/textarea.cjs +0 -122
  218. package/dist/lib/textarea/textarea.module.scss.cjs +0 -14
  219. package/dist/lib/time-picker/time-picker.cjs +0 -305
  220. package/dist/lib/tooltip/tooltip.cjs +0 -124
  221. package/dist/lib/trans-html/trans-html.cjs +0 -26
  222. package/dist/lib/unordered-list/list-item/helpers.cjs +0 -14
  223. package/dist/lib/unordered-list/list-item/list-item.cjs +0 -36
  224. package/dist/lib/unordered-list/unordered-list/helpers.cjs +0 -14
  225. package/dist/lib/unordered-list/unordered-list/unordered-list.cjs +0 -27
  226. package/dist/lib/video/helpers.cjs +0 -10
  227. package/dist/lib/video/video.cjs +0 -24
  228. package/dist/theme/index.cjs +0 -22
  229. package/dist/theme/palette.cjs +0 -287
  230. package/dist/theme/provider.cjs +0 -303
  231. package/dist/theme/screens.cjs +0 -24
  232. package/dist/theme/typography.cjs +0 -29
  233. package/dist/types/index.cjs +0 -1
  234. package/dist/utils/common.cjs +0 -139
  235. package/dist/utils/emotion-helpers.cjs +0 -145
  236. package/dist/utils/index.cjs +0 -233
  237. package/dist/utils/query-params.cjs +0 -130
  238. package/dist/utils/stylesheet.cjs +0 -5
@@ -1,303 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("@emotion/react/jsx-runtime");
4
- const react = require("@emotion/react");
5
- const theme_palette = require("./palette.cjs");
6
- const flat = require("flat");
7
- const lodashEs = require("lodash-es");
8
- const theme_typography = require("./typography.cjs");
9
- const ThemeProvider = ({ theme, children }) => {
10
- return /* @__PURE__ */ jsxRuntime.jsxs(react.ThemeProvider, { theme, children: [
11
- /* @__PURE__ */ jsxRuntime.jsx(react.Global, { styles: createGlobalStyle(theme) }),
12
- children
13
- ] });
14
- };
15
- const createGlobalStyle = ({ palette, typography }) => {
16
- const flattenPalette = flat.flatten(palette);
17
- const colorVars = Object.fromEntries(
18
- Object.keys(flattenPalette).map((key) => [
19
- theme_palette.getColorVar(key, false),
20
- flattenPalette[key]
21
- ])
22
- );
23
- const typographyVars = Object.fromEntries(
24
- lodashEs.flatMap(
25
- Object.keys(typography).map((key) => {
26
- const typographyVar = theme_typography.getTypographyVar(
27
- key,
28
- false
29
- );
30
- const { fontSize, lineHeight } = typography[key];
31
- return [
32
- [typographyVar.fontSize, fontSize],
33
- [typographyVar.lineHeight, lineHeight]
34
- ];
35
- })
36
- )
37
- );
38
- return {
39
- // ─── Reset / Preflight ───────────────────────────────────────────────────
40
- // 1. Prevent padding and border from affecting element width.
41
- // 2. Allow adding a border to an element by just adding a border-width.
42
- "*, ::before, ::after": {
43
- boxSizing: "border-box",
44
- // 1
45
- borderWidth: 0,
46
- // 2
47
- borderStyle: "solid",
48
- // 2
49
- borderColor: theme_palette.getColorVar("border.default")
50
- },
51
- // 1. Use a consistent sensible line-height in all browsers.
52
- // 2. Prevent adjustments of font size after orientation changes in iOS.
53
- // 3. Use a more readable tab size.
54
- // 4. Use the user's configured `sans` font-family by default.
55
- // 5. Use the user's configured `sans` font-feature-settings by default.
56
- // 6. Use the user's configured `sans` font-variation-settings by default.
57
- // 7. Disable tap highlights on iOS
58
- "html, :host": {
59
- lineHeight: 1.5,
60
- // 1
61
- WebkitTextSizeAdjust: "100%",
62
- // 2
63
- MozTabSize: 4,
64
- // 3
65
- tabSize: 4,
66
- // 3
67
- fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
68
- // 4
69
- fontFeatureSettings: "normal",
70
- // 5
71
- fontVariationSettings: "normal",
72
- // 6
73
- WebkitTapHighlightColor: "transparent"
74
- // 7
75
- },
76
- // 1. Remove the margin in all browsers.
77
- // 2. Inherit line-height from `html` — overridden below by app-level typography.
78
- body: {
79
- margin: 0,
80
- // 1
81
- // ─── App-level styles ───────────────────────────────────────────
82
- display: "flex",
83
- flexDirection: "column",
84
- minHeight: "100dvh",
85
- color: theme_palette.getColorVar("neutral.600"),
86
- backgroundColor: theme_palette.getColorVar("background.default"),
87
- fontSize: theme_typography.getTypographyVar("sm").fontSize,
88
- lineHeight: theme_typography.getTypographyVar("sm").lineHeight
89
- },
90
- // 1. Add the correct height in Firefox.
91
- // 2. Correct the inheritance of border color in Firefox.
92
- // 3. Ensure horizontal rules are visible by default.
93
- hr: {
94
- height: 0,
95
- // 1
96
- color: "inherit",
97
- // 2
98
- borderTopWidth: "1px"
99
- // 3
100
- },
101
- // Add the correct text decoration in Chrome, Edge, and Safari.
102
- "abbr:where([title])": {
103
- textDecoration: "underline dotted"
104
- },
105
- // Remove the default font size and weight for headings.
106
- "h1, h2, h3, h4, h5, h6": {
107
- fontSize: "inherit",
108
- fontWeight: "inherit"
109
- },
110
- // Reset links to optimize for opt-in styling instead of opt-out.
111
- a: {
112
- color: "inherit",
113
- textDecoration: "inherit"
114
- },
115
- // Add the correct font weight in Edge and Safari.
116
- "b, strong": {
117
- fontWeight: "bolder"
118
- },
119
- // 1. Use the user's configured `mono` font-family by default.
120
- // 2. Use the user's configured `mono` font-feature-settings by default.
121
- // 3. Use the user's configured `mono` font-variation-settings by default.
122
- // 4. Correct the odd `em` font sizing in all browsers.
123
- "code, kbd, samp, pre": {
124
- fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
125
- // 1
126
- fontFeatureSettings: "normal",
127
- // 2
128
- fontVariationSettings: "normal",
129
- // 3
130
- fontSize: "1em"
131
- // 4
132
- },
133
- // Add the correct font size in all browsers.
134
- small: {
135
- fontSize: "80%"
136
- },
137
- // Prevent `sub` and `sup` elements from affecting the line height in all browsers.
138
- "sub, sup": {
139
- fontSize: "75%",
140
- lineHeight: 0,
141
- position: "relative",
142
- verticalAlign: "baseline"
143
- },
144
- sub: {
145
- bottom: "-0.25em"
146
- },
147
- sup: {
148
- top: "-0.5em"
149
- },
150
- // 1. Remove text indentation from table contents in Chrome and Safari.
151
- // 2. Correct table border color inheritance in all Chrome and Safari.
152
- // 3. Remove gaps between table borders by default.
153
- table: {
154
- textIndent: 0,
155
- // 1
156
- borderColor: "inherit",
157
- // 2
158
- borderCollapse: "collapse"
159
- // 3
160
- },
161
- // 1. Change the font styles in all browsers.
162
- // 2. Remove the margin in Firefox and Safari.
163
- // 3. Remove default padding in all browsers.
164
- "button, input, optgroup, select, textarea": {
165
- fontFamily: "inherit",
166
- // 1
167
- fontFeatureSettings: "inherit",
168
- // 1
169
- fontVariationSettings: "inherit",
170
- // 1
171
- fontSize: "100%",
172
- // 1
173
- fontWeight: "inherit",
174
- // 1
175
- lineHeight: "inherit",
176
- // 1
177
- letterSpacing: "inherit",
178
- // 1
179
- color: "inherit",
180
- // 1
181
- margin: 0,
182
- // 2
183
- padding: 0
184
- // 3
185
- },
186
- // Remove the inheritance of text transform in Edge and Firefox.
187
- "button, select": {
188
- textTransform: "none"
189
- },
190
- // 1. Correct the inability to style clickable types in iOS and Safari.
191
- // 2. Remove default button styles.
192
- "button, input:where([type='button']), input:where([type='reset']), input:where([type='submit'])": {
193
- WebkitAppearance: "button",
194
- // 1
195
- backgroundColor: "transparent",
196
- // 2
197
- backgroundImage: "none"
198
- // 2
199
- },
200
- // Use the modern Firefox focus style for all focusable elements.
201
- ":-moz-focusring": {
202
- outline: "auto"
203
- },
204
- // Remove the additional `:invalid` styles in Firefox.
205
- ":-moz-ui-invalid": {
206
- boxShadow: "none"
207
- },
208
- // Add the correct vertical alignment in Chrome and Firefox.
209
- progress: {
210
- verticalAlign: "baseline"
211
- },
212
- // Correct the cursor style of increment and decrement buttons in Safari.
213
- "::-webkit-inner-spin-button, ::-webkit-outer-spin-button": {
214
- height: "auto"
215
- },
216
- // 1. Correct the odd appearance in Chrome and Safari.
217
- // 2. Correct the outline style in Safari.
218
- "[type='search']": {
219
- WebkitAppearance: "textfield",
220
- // 1
221
- outlineOffset: "-2px"
222
- // 2
223
- },
224
- // Remove the inner padding in Chrome and Safari on macOS.
225
- "::-webkit-search-decoration": {
226
- WebkitAppearance: "none"
227
- },
228
- // 1. Correct the inability to style clickable types in iOS and Safari.
229
- // 2. Change font properties to `inherit` in Safari.
230
- "::-webkit-file-upload-button": {
231
- WebkitAppearance: "button",
232
- // 1
233
- font: "inherit"
234
- // 2
235
- },
236
- // Add the correct display in Chrome and Safari.
237
- summary: {
238
- display: "list-item"
239
- },
240
- // Removes the default spacing and border for appropriate elements.
241
- "blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre": {
242
- margin: 0
243
- },
244
- fieldset: {
245
- margin: 0,
246
- padding: 0
247
- },
248
- legend: {
249
- padding: 0
250
- },
251
- "ol, ul, menu": {
252
- listStyle: "none",
253
- margin: 0,
254
- padding: 0
255
- },
256
- // Reset default styling for dialogs.
257
- dialog: {
258
- padding: 0
259
- },
260
- // Prevent resizing textareas horizontally by default.
261
- textarea: {
262
- resize: "vertical"
263
- },
264
- // 1. Reset the default placeholder opacity in Firefox.
265
- // 2. Set the default placeholder color to gray 400.
266
- "input::placeholder, textarea::placeholder": {
267
- opacity: 1,
268
- // 1
269
- color: theme_palette.getColorVar("neutral.400")
270
- },
271
- // Set the default cursor for buttons.
272
- "button, [role='button']": {
273
- cursor: "pointer"
274
- },
275
- // Make sure disabled buttons don't get the pointer cursor.
276
- ":disabled": {
277
- cursor: "default"
278
- },
279
- // 1. Make replaced elements `display: block` by default.
280
- // 2. Add `vertical-align: middle` to align replaced elements more sensibly by default.
281
- "img, svg, video, canvas, audio, iframe, embed, object": {
282
- display: "block",
283
- // 1
284
- verticalAlign: "middle"
285
- // 2
286
- },
287
- // Constrain images and videos to the parent width and preserve their intrinsic aspect ratio.
288
- "img, video": {
289
- maxWidth: "100%",
290
- height: "auto"
291
- },
292
- // Make elements with the HTML hidden attribute stay hidden by default.
293
- "[hidden]:where(:not([hidden='until-found']))": {
294
- display: "none"
295
- },
296
- // ─── CSS Variables ───────────────────────────────────────────────────────
297
- ":root": {
298
- ...colorVars,
299
- ...typographyVars
300
- }
301
- };
302
- };
303
- exports.ThemeProvider = ThemeProvider;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const lodashEs = require("lodash-es");
4
- const breakpoint = {
5
- xs: { minWidth: 0, padding: 16 },
6
- // mobile
7
- sm: { minWidth: 768, padding: 28 },
8
- // tablet
9
- md: { minWidth: 1280, padding: 40 },
10
- // desktop
11
- lg: { minWidth: 1680, padding: 40 }
12
- // large desktop
13
- };
14
- const screens = ["xs", "sm", "md", "lg"];
15
- const getSmallerScreens = (screen) => {
16
- return screens.slice(0, screens.indexOf(screen)).reverse();
17
- };
18
- const mediaQuery = (value) => {
19
- return `@media (min-width: ${lodashEs.isNumber(value) ? value : breakpoint[value].minWidth}px)`;
20
- };
21
- exports.breakpoint = breakpoint;
22
- exports.getSmallerScreens = getSmallerScreens;
23
- exports.mediaQuery = mediaQuery;
24
- exports.screens = screens;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getTypographyVar = (key, fullVar = true) => {
4
- const value = `--text-${key}--{{property}}`;
5
- const cssVar = fullVar ? `var(${value})` : value;
6
- return {
7
- fontSize: cssVar.replace("{{property}}", "font-size"),
8
- lineHeight: cssVar.replace("{{property}}", "line-height")
9
- };
10
- };
11
- const typographyVars = {
12
- xs: getTypographyVar("xs"),
13
- sm: getTypographyVar("sm"),
14
- base: getTypographyVar("base"),
15
- lg: getTypographyVar("lg"),
16
- xl: getTypographyVar("xl"),
17
- "2xl": getTypographyVar("2xl"),
18
- "3xl": getTypographyVar("3xl"),
19
- "4xl": getTypographyVar("4xl"),
20
- "5xl": getTypographyVar("5xl"),
21
- "6xl": getTypographyVar("6xl")
22
- };
23
- const getSmallerTypographyVariants = (variant) => {
24
- const allVariants = ["xs", "sm", "base", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl"];
25
- return allVariants.slice(0, allVariants.indexOf(variant)).reverse();
26
- };
27
- exports.getSmallerTypographyVariants = getSmallerTypographyVariants;
28
- exports.getTypographyVar = getTypographyVar;
29
- exports.typographyVars = typographyVars;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,139 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
4
- const parse = require("html-react-parser");
5
- const lodashEs = require("lodash-es");
6
- const slugify = require("slugify");
7
- const constants_index = require("../constants/index.cjs");
8
- const ensureArray = (val) => {
9
- if (lodashEs.isNil(val)) {
10
- return [];
11
- }
12
- if (Array.isArray(val)) {
13
- return val;
14
- }
15
- return [val];
16
- };
17
- const ensureBoolean = (val) => {
18
- if (lodashEs.isNil(val)) {
19
- return false;
20
- }
21
- if (lodashEs.isBoolean(val)) {
22
- return val;
23
- }
24
- return val === constants_index.Booleanish.True;
25
- };
26
- const normalizeSearchText = (str, options = {}) => {
27
- const { lower = true, trim = true } = options ?? {};
28
- let normalized = str == null ? void 0 : str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[đĐ]/g, (m) => m === "đ" ? "d" : "D");
29
- if (lower) {
30
- normalized = normalized == null ? void 0 : normalized.toLowerCase();
31
- }
32
- if (trim) {
33
- normalized = normalized == null ? void 0 : normalized.trim();
34
- }
35
- return normalized ?? "";
36
- };
37
- const matchSearch = (text, searchText, options) => {
38
- const normalizedSearchText = normalizeSearchText(searchText, options);
39
- return ensureArray(text).some((entry) => {
40
- return normalizeSearchText(entry, options).includes(normalizedSearchText);
41
- });
42
- };
43
- const createSlug = (text) => {
44
- return slugify(lodashEs.kebabCase(text.toLowerCase()), {
45
- lower: true
46
- });
47
- };
48
- const formatNumber = (value, { lng, ...options }) => {
49
- try {
50
- return new Intl.NumberFormat(lng, {
51
- minimumFractionDigits: 0,
52
- ...options
53
- }).format(value);
54
- } catch (error) {
55
- return value.toString();
56
- }
57
- };
58
- const getDecimalDigits = (value) => {
59
- var _a;
60
- return ((_a = value.toString().split(".").at(1)) == null ? void 0 : _a.length) ?? 0;
61
- };
62
- const parseNumber = (text, type = "int", separator = ",") => {
63
- const parseFunc = type === "int" ? lodashEs.parseInt : parseFloat;
64
- const parsedValue = parseFunc((text ?? "").toString().trim().replaceAll(separator, ""));
65
- return isNaN(parsedValue) ? void 0 : parsedValue;
66
- };
67
- function omitEmpty(obj) {
68
- if (lodashEs.isNil(obj)) return {};
69
- return lodashEs.omitBy(obj, (value) => {
70
- if (lodashEs.isNil(value)) {
71
- return true;
72
- }
73
- if (lodashEs.isArray(value) || lodashEs.isString(value)) {
74
- return value.length === 0;
75
- }
76
- return false;
77
- });
78
- }
79
- const getEnumValues = (enumObject) => {
80
- return Object.keys(enumObject).filter((key) => isNaN(Number(key))).map((key) => enumObject[key]);
81
- };
82
- function parseSvgString(source, uniqueId) {
83
- const createUniqueId = (originalId) => {
84
- return `${originalId}-${uniqueId}`;
85
- };
86
- const options = {
87
- replace(domNode) {
88
- if (domNode.type === "tag" && "attribs" in domNode && domNode.attribs) {
89
- const el = domNode;
90
- if (el.attribs.id) {
91
- el.attribs.id = createUniqueId(el.attribs.id);
92
- }
93
- const urlRefAttrs = [
94
- "fill",
95
- "stroke",
96
- "filter",
97
- "clip-path",
98
- "mask",
99
- "marker-start",
100
- "marker-mid",
101
- "marker-end",
102
- "style"
103
- ];
104
- for (const attr of urlRefAttrs) {
105
- const value = el.attribs[attr];
106
- if (!value) continue;
107
- if (attr === "style") {
108
- const match = value == null ? void 0 : value.match(/url\(#(.+?)\)/);
109
- if (match) {
110
- el.attribs[attr] = value.replace(match[1], createUniqueId(match[1]));
111
- }
112
- } else {
113
- const match = value == null ? void 0 : value.match(/^url\(#(.+?)\)$/);
114
- if (match) {
115
- el.attribs[attr] = `url(#${createUniqueId(match[1])})`;
116
- }
117
- }
118
- }
119
- return el;
120
- }
121
- return void 0;
122
- },
123
- trim: true
124
- };
125
- const parsed = parse(source, options);
126
- const validType = "svg";
127
- return react.isValidElement(parsed) && parsed.type === validType ? parsed : null;
128
- }
129
- exports.createSlug = createSlug;
130
- exports.ensureArray = ensureArray;
131
- exports.ensureBoolean = ensureBoolean;
132
- exports.formatNumber = formatNumber;
133
- exports.getDecimalDigits = getDecimalDigits;
134
- exports.getEnumValues = getEnumValues;
135
- exports.matchSearch = matchSearch;
136
- exports.normalizeSearchText = normalizeSearchText;
137
- exports.omitEmpty = omitEmpty;
138
- exports.parseNumber = parseNumber;
139
- exports.parseSvgString = parseSvgString;
@@ -1,145 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("@emotion/react");
4
- const theme_screens = require("../theme/screens.cjs");
5
- const theme_typography = require("../theme/typography.cjs");
6
- const scrollbarNone = {
7
- scrollbarWidth: "none",
8
- "&::-webkit-scrollbar": { display: "none" }
9
- };
10
- const pulseKeyframes = react.keyframes`
11
- 50% { opacity: 0.5; }
12
- `;
13
- const spinKeyframes = react.keyframes`
14
- to { transform: rotate(360deg); }
15
- `;
16
- const animatePulse = {
17
- animation: `${pulseKeyframes} 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`
18
- };
19
- const animateSpin = {
20
- animation: `${spinKeyframes} 1s linear infinite`
21
- };
22
- const ptBlock = {
23
- paddingTop: "1rem",
24
- [theme_screens.mediaQuery("sm")]: { paddingTop: "1.5rem" },
25
- [theme_screens.mediaQuery("md")]: { paddingTop: "2rem" },
26
- [theme_screens.mediaQuery("lg")]: { paddingTop: "2.5rem" }
27
- };
28
- const pbBlock = {
29
- paddingBottom: "1rem",
30
- [theme_screens.mediaQuery("sm")]: { paddingBottom: "1.5rem" },
31
- [theme_screens.mediaQuery("md")]: { paddingBottom: "2rem" },
32
- [theme_screens.mediaQuery("lg")]: { paddingBottom: "2.5rem" }
33
- };
34
- const pyBlock = {
35
- paddingTop: "1rem",
36
- paddingBottom: "1rem",
37
- [theme_screens.mediaQuery("sm")]: { paddingTop: "1.5rem", paddingBottom: "1.5rem" },
38
- [theme_screens.mediaQuery("md")]: { paddingTop: "2rem", paddingBottom: "2rem" },
39
- [theme_screens.mediaQuery("lg")]: { paddingTop: "2.5rem", paddingBottom: "2.5rem" }
40
- };
41
- const textHeading6 = {
42
- fontSize: theme_typography.getTypographyVar("lg").fontSize,
43
- lineHeight: theme_typography.getTypographyVar("lg").lineHeight,
44
- [theme_screens.mediaQuery(theme_screens.breakpoint.md.minWidth)]: {
45
- fontSize: theme_typography.getTypographyVar("xl").fontSize,
46
- lineHeight: theme_typography.getTypographyVar("xl").lineHeight
47
- }
48
- };
49
- const textHeading5 = {
50
- fontSize: theme_typography.getTypographyVar("xl").fontSize,
51
- lineHeight: theme_typography.getTypographyVar("xl").lineHeight,
52
- [theme_screens.mediaQuery(theme_screens.breakpoint.md.minWidth)]: {
53
- fontSize: theme_typography.getTypographyVar("2xl").fontSize,
54
- lineHeight: theme_typography.getTypographyVar("2xl").lineHeight
55
- }
56
- };
57
- const textHeading4 = {
58
- fontSize: theme_typography.getTypographyVar("2xl").fontSize,
59
- lineHeight: theme_typography.getTypographyVar("2xl").lineHeight,
60
- [theme_screens.mediaQuery(theme_screens.breakpoint.md.minWidth)]: {
61
- fontSize: theme_typography.getTypographyVar("3xl").fontSize,
62
- lineHeight: theme_typography.getTypographyVar("3xl").lineHeight
63
- }
64
- };
65
- const textHeading3 = {
66
- fontSize: theme_typography.getTypographyVar("3xl").fontSize,
67
- lineHeight: theme_typography.getTypographyVar("3xl").lineHeight,
68
- [theme_screens.mediaQuery(theme_screens.breakpoint.md.minWidth)]: {
69
- fontSize: theme_typography.getTypographyVar("4xl").fontSize,
70
- lineHeight: theme_typography.getTypographyVar("4xl").lineHeight
71
- }
72
- };
73
- const textHeading2 = {
74
- fontSize: theme_typography.getTypographyVar("4xl").fontSize,
75
- lineHeight: theme_typography.getTypographyVar("4xl").lineHeight,
76
- [theme_screens.mediaQuery(theme_screens.breakpoint.md.minWidth)]: {
77
- fontSize: theme_typography.getTypographyVar("5xl").fontSize,
78
- lineHeight: theme_typography.getTypographyVar("5xl").lineHeight
79
- }
80
- };
81
- const textHeading1 = {
82
- fontSize: theme_typography.getTypographyVar("5xl").fontSize,
83
- lineHeight: theme_typography.getTypographyVar("5xl").lineHeight,
84
- [theme_screens.mediaQuery(theme_screens.breakpoint.md.minWidth)]: {
85
- fontSize: theme_typography.getTypographyVar("6xl").fontSize,
86
- lineHeight: theme_typography.getTypographyVar("6xl").lineHeight
87
- }
88
- };
89
- const truncate = {
90
- overflow: "hidden",
91
- textOverflow: "ellipsis",
92
- whiteSpace: "nowrap"
93
- };
94
- const pointerEventsNone = {
95
- pointerEvents: "none"
96
- };
97
- const cursorPointer = {
98
- cursor: "pointer"
99
- };
100
- const overflowHidden = {
101
- overflow: "hidden"
102
- };
103
- const overflowAuto = {
104
- overflow: "auto"
105
- };
106
- const containerStyle = {
107
- width: "100%",
108
- marginLeft: "auto",
109
- marginRight: "auto",
110
- paddingLeft: `${theme_screens.breakpoint.xs.padding}px`,
111
- paddingRight: `${theme_screens.breakpoint.xs.padding}px`,
112
- [theme_screens.mediaQuery("sm")]: {
113
- maxWidth: `${theme_screens.breakpoint.sm.minWidth}px`,
114
- paddingLeft: `${theme_screens.breakpoint.sm.padding}px`,
115
- paddingRight: `${theme_screens.breakpoint.sm.padding}px`
116
- },
117
- [theme_screens.mediaQuery("md")]: {
118
- maxWidth: `${theme_screens.breakpoint.md.minWidth}px`,
119
- paddingLeft: `${theme_screens.breakpoint.md.padding}px`,
120
- paddingRight: `${theme_screens.breakpoint.md.padding}px`
121
- },
122
- [theme_screens.mediaQuery("lg")]: {
123
- maxWidth: `${theme_screens.breakpoint.lg.minWidth}px`,
124
- paddingLeft: `${theme_screens.breakpoint.lg.padding}px`,
125
- paddingRight: `${theme_screens.breakpoint.lg.padding}px`
126
- }
127
- };
128
- exports.animatePulse = animatePulse;
129
- exports.animateSpin = animateSpin;
130
- exports.containerStyle = containerStyle;
131
- exports.cursorPointer = cursorPointer;
132
- exports.overflowAuto = overflowAuto;
133
- exports.overflowHidden = overflowHidden;
134
- exports.pbBlock = pbBlock;
135
- exports.pointerEventsNone = pointerEventsNone;
136
- exports.ptBlock = ptBlock;
137
- exports.pyBlock = pyBlock;
138
- exports.scrollbarNone = scrollbarNone;
139
- exports.textHeading1 = textHeading1;
140
- exports.textHeading2 = textHeading2;
141
- exports.textHeading3 = textHeading3;
142
- exports.textHeading4 = textHeading4;
143
- exports.textHeading5 = textHeading5;
144
- exports.textHeading6 = textHeading6;
145
- exports.truncate = truncate;