@salt-ds/core 1.55.0 → 1.56.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 (71) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/css/salt-core.css +181 -1
  3. package/dist-cjs/index.js +17 -0
  4. package/dist-cjs/index.js.map +1 -1
  5. package/dist-cjs/salt-provider/ThemeApplicator.js.map +1 -1
  6. package/dist-cjs/spinner/svgSpinners/SpinnerSVG.js +6 -3
  7. package/dist-cjs/spinner/svgSpinners/SpinnerSVG.js.map +1 -1
  8. package/dist-cjs/table/TBody.js +32 -0
  9. package/dist-cjs/table/TBody.js.map +1 -0
  10. package/dist-cjs/table/TD.js +34 -0
  11. package/dist-cjs/table/TD.js.map +1 -0
  12. package/dist-cjs/table/TFoot.js +45 -0
  13. package/dist-cjs/table/TFoot.js.map +1 -0
  14. package/dist-cjs/table/TH.js +34 -0
  15. package/dist-cjs/table/TH.js.map +1 -0
  16. package/dist-cjs/table/THead.js +45 -0
  17. package/dist-cjs/table/THead.js.map +1 -0
  18. package/dist-cjs/table/TR.js +30 -0
  19. package/dist-cjs/table/TR.js.map +1 -0
  20. package/dist-cjs/table/Table.css.js +6 -0
  21. package/dist-cjs/table/Table.css.js.map +1 -0
  22. package/dist-cjs/table/Table.js +71 -0
  23. package/dist-cjs/table/Table.js.map +1 -0
  24. package/dist-cjs/table/TableContainer.js +85 -0
  25. package/dist-cjs/table/TableContainer.js.map +1 -0
  26. package/dist-cjs/table/TableContext.js +26 -0
  27. package/dist-cjs/table/TableContext.js.map +1 -0
  28. package/dist-cjs/theme/Density.js +7 -1
  29. package/dist-cjs/theme/Density.js.map +1 -1
  30. package/dist-es/index.js +8 -0
  31. package/dist-es/index.js.map +1 -1
  32. package/dist-es/salt-provider/ThemeApplicator.js.map +1 -1
  33. package/dist-es/spinner/svgSpinners/SpinnerSVG.js +6 -3
  34. package/dist-es/spinner/svgSpinners/SpinnerSVG.js.map +1 -1
  35. package/dist-es/table/TBody.js +30 -0
  36. package/dist-es/table/TBody.js.map +1 -0
  37. package/dist-es/table/TD.js +32 -0
  38. package/dist-es/table/TD.js.map +1 -0
  39. package/dist-es/table/TFoot.js +43 -0
  40. package/dist-es/table/TFoot.js.map +1 -0
  41. package/dist-es/table/TH.js +32 -0
  42. package/dist-es/table/TH.js.map +1 -0
  43. package/dist-es/table/THead.js +43 -0
  44. package/dist-es/table/THead.js.map +1 -0
  45. package/dist-es/table/TR.js +28 -0
  46. package/dist-es/table/TR.js.map +1 -0
  47. package/dist-es/table/Table.css.js +4 -0
  48. package/dist-es/table/Table.css.js.map +1 -0
  49. package/dist-es/table/Table.js +68 -0
  50. package/dist-es/table/Table.js.map +1 -0
  51. package/dist-es/table/TableContainer.js +83 -0
  52. package/dist-es/table/TableContainer.js.map +1 -0
  53. package/dist-es/table/TableContext.js +23 -0
  54. package/dist-es/table/TableContext.js.map +1 -0
  55. package/dist-es/theme/Density.js +7 -1
  56. package/dist-es/theme/Density.js.map +1 -1
  57. package/dist-types/index.d.ts +1 -0
  58. package/dist-types/salt-provider/SaltProvider.d.ts +1 -1
  59. package/dist-types/salt-provider/ThemeApplicator.d.ts +1 -1
  60. package/dist-types/table/TBody.d.ts +4 -0
  61. package/dist-types/table/TD.d.ts +10 -0
  62. package/dist-types/table/TFoot.d.ts +20 -0
  63. package/dist-types/table/TH.d.ts +10 -0
  64. package/dist-types/table/THead.d.ts +20 -0
  65. package/dist-types/table/TR.d.ts +4 -0
  66. package/dist-types/table/Table.d.ts +20 -0
  67. package/dist-types/table/TableContainer.d.ts +4 -0
  68. package/dist-types/table/TableContext.d.ts +8 -0
  69. package/dist-types/table/index.d.ts +8 -0
  70. package/dist-types/theme/Density.d.ts +1 -1
  71. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @salt-ds/core
2
2
 
3
+ ## 1.56.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 972e37e: Added mobile density tokens.
8
+ - 4507919: Added table components, `Table`, `TBody`, `TD`, `TFoot`, `TH`, `THead`, `TR`, `TableContainer`.
9
+
10
+ `Table` is a basic HTML table intended for simple data display.
11
+
12
+ ```tsx
13
+ <TableContainer>
14
+ <Table>
15
+ <caption>Table name</caption>
16
+ <THead>
17
+ <TR>
18
+ <TH>Header 1</TH>
19
+ <TH>Header 2</TH>
20
+ </TR>
21
+ </THead>
22
+ <TBody>
23
+ <TR>
24
+ <TD>Row 1, Col 1</TD>
25
+ <TD>Row 1, Col 2</TD>
26
+ </TR>
27
+ <TR>
28
+ <TD>Row 2, Col 1</TD>
29
+ <TD>Row 2, Col 2</TD>
30
+ </TR>
31
+ </TBody>
32
+ <TFoot>
33
+ <TR>
34
+ <TD>Footer 1</TD>
35
+ <TD>Footer 2</TD>
36
+ </TR>
37
+ </TFoot>
38
+ </Table>
39
+ </TableContainer>
40
+ ```
41
+
3
42
  ## 1.55.0
4
43
 
5
44
  ### Minor Changes
package/css/salt-core.css CHANGED
@@ -4107,6 +4107,186 @@ a:focus .saltCard-interactable.saltCard-disabled {
4107
4107
  padding-bottom: var(--salt-spacing-50);
4108
4108
  }
4109
4109
 
4110
+ /* src/table/Table.css */
4111
+ .saltTable {
4112
+ --table-header-height: calc(var(--salt-size-base) + var(--salt-spacing-100) + var(--salt-size-fixed-100));
4113
+ --table-footer-height: calc(var(--salt-size-base) + var(--salt-spacing-100) + var(--salt-size-fixed-100));
4114
+ --table-row-height: calc(var(--salt-size-base) + var(--salt-spacing-100) + var(--salt-size-fixed-100));
4115
+ }
4116
+ .saltTable-primary {
4117
+ --table-background: var(--salt-container-primary-background);
4118
+ }
4119
+ .saltTable-secondary {
4120
+ --table-background: var(--salt-container-secondary-background);
4121
+ }
4122
+ .saltTable-tertiary {
4123
+ --table-background: var(--salt-container-tertiary-background);
4124
+ }
4125
+ .saltTable-divider-primary {
4126
+ --table-divider-color: var(--salt-separable-primary-borderColor);
4127
+ }
4128
+ .saltTable-divider-secondary {
4129
+ --table-divider-color: var(--salt-separable-secondary-borderColor);
4130
+ }
4131
+ .saltTable-divider-tertiary {
4132
+ --table-divider-color: var(--salt-separable-tertiary-borderColor);
4133
+ }
4134
+ table.saltTable-zebra-tertiary tbody tr:nth-of-type(odd) {
4135
+ --table-background: var(--salt-container-tertiary-background);
4136
+ }
4137
+ table.saltTable-primary.saltTable-zebra tbody tr:nth-of-type(odd) {
4138
+ --table-background: var(--salt-container-secondary-background);
4139
+ }
4140
+ table.saltTable-secondary.saltTable-zebra tbody tr:nth-of-type(odd) {
4141
+ --table-background: var(--salt-container-primary-background);
4142
+ }
4143
+ table.saltTable-tertiary.saltTable-zebra tbody tr:nth-of-type(odd) {
4144
+ --table-background: var(--salt-container-primary-background);
4145
+ }
4146
+ table.saltTable {
4147
+ border-spacing: 0;
4148
+ border-radius: var(--salt-palette-corner, 0);
4149
+ border-collapse: collapse;
4150
+ color: var(--salt-content-primary-foreground);
4151
+ font-family: var(--salt-text-fontFamily);
4152
+ font-size: var(--salt-text-fontSize);
4153
+ line-height: var(--salt-text-lineHeight);
4154
+ width: 100%;
4155
+ }
4156
+ table.saltTable tr {
4157
+ background: var(--table-background);
4158
+ }
4159
+ table.saltTable tbody tr {
4160
+ height: var(--table-row-height);
4161
+ min-height: var(--table-row-height);
4162
+ }
4163
+ table.saltTable tbody tr:not(:last-child) {
4164
+ border-bottom: var(--salt-borderStyle-solid) var(--table-divider-color) var(--salt-size-fixed-100);
4165
+ }
4166
+ table.saltTable.saltTable-divider-none tbody tr {
4167
+ --table-divider-color: transparent;
4168
+ }
4169
+ table.saltTable thead {
4170
+ border-start-start-radius: var(--salt-palette-corner);
4171
+ border-start-end-radius: var(--salt-palette-corner);
4172
+ color: var(--salt-content-secondary-foreground);
4173
+ height: var(--table-header-height);
4174
+ min-height: var(--table-header-height);
4175
+ font-size: var(--salt-text-label-fontSize);
4176
+ font-weight: var(--salt-text-label-fontWeight-strong);
4177
+ line-height: var(--salt-text-label-lineHeight);
4178
+ }
4179
+ table.saltTable thead.saltTable-thead-sticky {
4180
+ position: sticky;
4181
+ top: 0;
4182
+ }
4183
+ table.saltTable thead.saltTable-thead-primary tr {
4184
+ background: var(--salt-container-primary-background);
4185
+ }
4186
+ table.saltTable thead.saltTable-thead-secondary tr {
4187
+ background: var(--salt-container-secondary-background);
4188
+ }
4189
+ table.saltTable thead.saltTable-thead-tertiary tr {
4190
+ background: var(--salt-container-tertiary-background);
4191
+ }
4192
+ table.saltTable thead.saltTable-thead tr {
4193
+ border-bottom: var(--salt-borderStyle-solid) var(--table-header-divider-color) var(--salt-size-fixed-100);
4194
+ }
4195
+ table.saltTable thead.saltTable-thead-divider-primary {
4196
+ --table-header-divider-color: var(--salt-separable-primary-borderColor);
4197
+ }
4198
+ table.saltTable thead.saltTable-thead-divider-secondary {
4199
+ --table-header-divider-color: var(--salt-separable-secondary-borderColor);
4200
+ }
4201
+ table.saltTable thead.saltTable-thead-divider-tertiary {
4202
+ --table-header-divider-color: var(--salt-separable-tertiary-borderColor);
4203
+ }
4204
+ table.saltTable thead.saltTable-thead-divider-none {
4205
+ --table-header-divider-color: transparent;
4206
+ }
4207
+ table.saltTable tfoot {
4208
+ border-end-start-radius: var(--salt-palette-corner);
4209
+ border-end-end-radius: var(--salt-palette-corner);
4210
+ color: var(--salt-content-primary-foreground);
4211
+ height: var(--table-footer-height);
4212
+ min-height: var(--table-footer-height);
4213
+ font-size: var(--salt-text-fontSize);
4214
+ line-height: var(--salt-text-lineHeight);
4215
+ font-weight: var(--salt-text-fontWeight-strong);
4216
+ }
4217
+ table.saltTable tfoot.saltTable-tfoot-sticky {
4218
+ position: sticky;
4219
+ bottom: 0;
4220
+ }
4221
+ table.saltTable tfoot.saltTable-tfoot tr {
4222
+ border-top: var(--salt-borderStyle-solid) var(--table-footer-divider-color) var(--salt-size-fixed-100);
4223
+ }
4224
+ table.saltTable tfoot.saltTable-tfoot-primary tr {
4225
+ background: var(--salt-container-primary-background);
4226
+ }
4227
+ table.saltTable tfoot.saltTable-tfoot-secondary tr {
4228
+ background: var(--salt-container-secondary-background);
4229
+ }
4230
+ table.saltTable tfoot.saltTable-tfoot-tertiary tr {
4231
+ background: var(--salt-container-tertiary-background);
4232
+ }
4233
+ table.saltTable tfoot.saltTable-tfoot-divider-primary tr {
4234
+ --table-footer-divider-color: var(--salt-separable-primary-borderColor);
4235
+ }
4236
+ table.saltTable tfoot.saltTable-tfoot-divider-secondary tr {
4237
+ --table-footer-divider-color: var(--salt-separable-secondary-borderColor);
4238
+ }
4239
+ table.saltTable tfoot.saltTable-tfoot-divider-tertiary tr {
4240
+ --table-footer-divider-color: var(--salt-separable-tertiary-borderColor);
4241
+ }
4242
+ table.saltTable tfoot.saltTable-tfoot-divider-none tr {
4243
+ --table-footer-divider-color: transparent;
4244
+ }
4245
+ table.saltTable th {
4246
+ padding: calc(var(--salt-spacing-75) + var(--salt-spacing-50)) var(--salt-spacing-100);
4247
+ padding-top: calc(var(--salt-spacing-75) + var(--salt-spacing-50) + var(--salt-size-fixed-100));
4248
+ position: relative;
4249
+ text-align: start;
4250
+ vertical-align: top;
4251
+ font-weight: inherit;
4252
+ }
4253
+ table.saltTable th.saltTable-th-align-left {
4254
+ text-align: start;
4255
+ }
4256
+ table.saltTable th.saltTable-th-align-right {
4257
+ text-align: end;
4258
+ }
4259
+ table.saltTable tbody th[scope=row] {
4260
+ font-weight: var(--salt-text-fontWeight-strong);
4261
+ line-height: var(--salt-text-lineHeight);
4262
+ }
4263
+ table.saltTable th + th::before {
4264
+ background: var(--salt-separable-tertiary-borderColor);
4265
+ content: "";
4266
+ position: absolute;
4267
+ z-index: 1;
4268
+ display: block;
4269
+ width: var(--salt-size-fixed-100);
4270
+ height: calc(100% - var(--salt-spacing-200));
4271
+ left: 0;
4272
+ top: var(--salt-spacing-100);
4273
+ }
4274
+ table.saltTable td {
4275
+ height: 100%;
4276
+ vertical-align: top;
4277
+ padding: calc(var(--salt-spacing-75) + var(--salt-spacing-50)) var(--salt-spacing-100);
4278
+ }
4279
+ table.saltTable td.saltTable-td-align-left {
4280
+ text-align: start;
4281
+ }
4282
+ table.saltTable td.saltTable-td-align-right {
4283
+ text-align: end;
4284
+ }
4285
+ .saltTable-container {
4286
+ width: 100%;
4287
+ overflow: auto;
4288
+ }
4289
+
4110
4290
  /* src/tag/Tag.css */
4111
4291
  .saltTag {
4112
4292
  height: calc(var(--salt-size-base) - var(--salt-spacing-100));
@@ -5580,4 +5760,4 @@ label.saltText small,
5580
5760
  color: var(--salt-status-error-foreground-informative);
5581
5761
  }
5582
5762
 
5583
- /* src/1463f447-906c-4b6c-9e48-a11d90979521.css */
5763
+ /* src/54a47adf-2206-4fc8-b932-3ebc87962e9a.css */
package/dist-cjs/index.js CHANGED
@@ -105,6 +105,14 @@ var ValidationStatus = require('./status-indicator/ValidationStatus.js');
105
105
  var Step = require('./stepper/Step.js');
106
106
  var Stepper = require('./stepper/Stepper.js');
107
107
  var Switch = require('./switch/Switch.js');
108
+ var Table = require('./table/Table.js');
109
+ var TableContainer = require('./table/TableContainer.js');
110
+ var TBody = require('./table/TBody.js');
111
+ var TD = require('./table/TD.js');
112
+ var TFoot = require('./table/TFoot.js');
113
+ var TH = require('./table/TH.js');
114
+ var THead = require('./table/THead.js');
115
+ var TR = require('./table/TR.js');
108
116
  var Tag = require('./tag/Tag.js');
109
117
  var Code = require('./text/Code.js');
110
118
  var Display = require('./text/Display.js');
@@ -290,6 +298,15 @@ exports.VALIDATION_NAMED_STATUS = ValidationStatus.VALIDATION_NAMED_STATUS;
290
298
  exports.Step = Step.Step;
291
299
  exports.Stepper = Stepper.Stepper;
292
300
  exports.Switch = Switch.Switch;
301
+ exports.Table = Table.Table;
302
+ exports.withTableBaseName = Table.withTableBaseName;
303
+ exports.TableContainer = TableContainer.TableContainer;
304
+ exports.TBody = TBody.TBody;
305
+ exports.TD = TD.TD;
306
+ exports.TFoot = TFoot.TFoot;
307
+ exports.TH = TH.TH;
308
+ exports.THead = THead.THead;
309
+ exports.TR = TR.TR;
293
310
  exports.Tag = Tag.Tag;
294
311
  exports.Code = Code.Code;
295
312
  exports.Display1 = Display.Display1;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeApplicator.js","sources":["../src/salt-provider/ThemeApplicator.tsx"],"sourcesContent":["import { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport {\n cloneElement,\n type HTMLAttributes,\n isValidElement,\n type ReactNode,\n} from \"react\";\nimport type {\n Accent,\n ActionFont,\n Corner,\n Density,\n HeadingFont,\n Mode,\n ThemeName,\n} from \"../theme/index\";\nimport { useId } from \"../utils/useId\";\nimport { useIsomorphicLayoutEffect } from \"../utils/useIsomorphicLayoutEffect\";\n\nexport interface ThemeApplicatorProps {\n /**\n * Either \"root\", \"scope\" or \"child\".\n * Specifies the location of salt theme class and attributes should be applied to.\n *\n * Defaults to \"root\" for a root provider, otherwise \"scope\".\n */\n applyClassesTo: \"root\" | \"scope\" | \"child\";\n /**\n * Either \"high\", \"medium\", \"low\" or \"touch\".\n * Determines the amount of content that can fit on a screen based on the size and spacing of components.\n * Refer to [density](https://www.saltdesignsystem.com/salt/foundations/density) doc for more detail.\n *\n * @default \"medium\"\n */\n density: Density;\n /**\n * A string. Specifies custom theme name(s) you want to apply, similar to `className`.\n */\n theme: ThemeName;\n /**\n * Either \"light\" or \"dark\". Enable the color palette to change from light to dark.\n * Refer to [modes](https://www.saltdesignsystem.com/salt/foundations/modes) doc for more detail.\n *\n * @default \"light\"\n */\n mode: Mode;\n /**\n * Either \"sharp\" or \"rounded\".\n * Determines selected components corner radius.\n * @default \"sharp\"\n */\n corner?: Corner;\n /**\n * Either \"Open Sans\" or \"Amplitude\".\n * Determines font family of display and heading text.\n * @default \"Open Sans\"\n */\n headingFont?: HeadingFont;\n /**\n * Either \"blue\" or \"teal\".\n * Determines accent color used across components, e.g. Accent Button, List, Calendar.\n * @default \"blue\"\n */\n accent?: Accent;\n /**\n * Either \"Open Sans\" or \"Amplitude\".\n * Determines font family of action components, mostly Buttons.\n * @default \"Open Sans\"\n */\n actionFont?: ActionFont;\n children?: ReactNode;\n}\n\nconst providerSymbol = Symbol.for(\"salt-provider\");\n\nexport function ThemeApplicator({\n applyClassesTo,\n children,\n density,\n mode,\n theme,\n corner,\n headingFont,\n accent,\n actionFont,\n}: ThemeApplicatorProps) {\n const targetWindow = useWindow();\n\n const providerId = useId();\n\n useIsomorphicLayoutEffect(() => {\n if (applyClassesTo !== \"root\" || !targetWindow || !providerId) return;\n\n const targetDocument: Document & { [providerSymbol]?: string } =\n targetWindow.document;\n\n // Claim the document if no other provider has already. The symbol is used so the lock isn't enumerable and guarantees it won't clash with anything else.\n if (!targetDocument[providerSymbol]) {\n targetDocument[providerSymbol] = providerId;\n }\n\n if (providerId !== targetDocument[providerSymbol]) {\n console.warn(\n \"Multiple providers targeting the same window. There can be only one level root level SaltProvider per window.\",\n );\n return;\n }\n\n const themeNames = theme.split(\" \");\n\n // add the styles we want to apply\n targetDocument.documentElement.classList.add(\n ...themeNames,\n `salt-density-${density}`,\n );\n targetDocument.documentElement.dataset.mode = mode;\n\n // Theme Next\n if (corner) targetDocument.documentElement.dataset.corner = corner;\n if (headingFont)\n targetDocument.documentElement.dataset.headingFont = headingFont;\n if (accent) targetDocument.documentElement.dataset.accent = accent;\n if (actionFont)\n targetDocument.documentElement.dataset.actionFont = actionFont;\n\n return () => {\n // Delete lock\n delete targetDocument[providerSymbol];\n\n // When unmounting/remounting, remove the applied styles from the root\n targetDocument.documentElement.classList.remove(\n ...themeNames,\n `salt-density-${density}`,\n );\n targetDocument.documentElement.dataset.mode = undefined;\n\n // Theme Next\n delete targetDocument.documentElement.dataset.corner;\n delete targetDocument.documentElement.dataset.headingFont;\n delete targetDocument.documentElement.dataset.accent;\n delete targetDocument.documentElement.dataset.actionFont;\n };\n }, [\n providerId,\n applyClassesTo,\n density,\n mode,\n theme,\n targetWindow,\n corner,\n headingFont,\n accent,\n actionFont,\n ]);\n\n const themeNextProps = {\n \"data-corner\": corner,\n \"data-heading-font\": headingFont,\n \"data-accent\": accent,\n \"data-action-font\": actionFont,\n };\n\n if (applyClassesTo === \"child\") {\n if (isValidElement<HTMLAttributes<HTMLElement>>(children)) {\n return cloneElement(children, {\n className: clsx(\n children.props?.className,\n theme,\n `salt-density-${density}`,\n ),\n // @ts-expect-error\n \"data-mode\": mode,\n ...themeNextProps,\n });\n }\n console.warn(\n `\\nSaltProvider can only apply CSS classes for theming to a single nested child element of the SaltProvider.\n Either wrap elements with a single container or consider removing the applyClassesToChild prop, in which case a\n div element will wrap your child elements`,\n );\n return children;\n }\n\n if (applyClassesTo === \"scope\") {\n return (\n <div\n className={clsx(\"salt-provider\", theme, `salt-density-${density}`)}\n data-mode={mode}\n {...themeNextProps}\n >\n {children}\n </div>\n );\n }\n\n return children;\n}\n"],"names":["useWindow","useId","useIsomorphicLayoutEffect","isValidElement","cloneElement","clsx","jsx"],"mappings":";;;;;;;;;AA0EA,MAAM,cAAA,GAAiB,MAAA,CAAO,GAAA,CAAI,eAAe,CAAA;AAE1C,SAAS,eAAA,CAAgB;AAAA,EAC9B,cAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAyB;AAtFzB,EAAA,IAAA,EAAA;AAuFE,EAAA,MAAM,eAAeA,gBAAA,EAAU;AAE/B,EAAA,MAAM,aAAaC,WAAA,EAAM;AAEzB,EAAAC,mDAAA,CAA0B,MAAM;AAC9B,IAAA,IAAI,cAAA,KAAmB,MAAA,IAAU,CAAC,YAAA,IAAgB,CAAC,UAAA,EAAY;AAE/D,IAAA,MAAM,iBACJ,YAAA,CAAa,QAAA;AAGf,IAAA,IAAI,CAAC,cAAA,CAAe,cAAc,CAAA,EAAG;AACnC,MAAA,cAAA,CAAe,cAAc,CAAA,GAAI,UAAA;AAAA,IACnC;AAEA,IAAA,IAAI,UAAA,KAAe,cAAA,CAAe,cAAc,CAAA,EAAG;AACjD,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN;AAAA,OACF;AACA,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,UAAA,GAAa,KAAA,CAAM,KAAA,CAAM,GAAG,CAAA;AAGlC,IAAA,cAAA,CAAe,gBAAgB,SAAA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aAAA,EAAe,MAAA;AAAA,IACf,mBAAA,EAAqB,WAAA;AAAA,IACrB,aAAA,EAAe,MAAA;AAAA,IACf,kBAAA,EAAoB;AAAA,GACtB;AAEA,EAAA,IAAI,mBAAmB,OAAA,EAAS;AAC9B,IAAA,IAAIC,oBAAA,CAA4C,QAAQ,CAAA,EAAG;AACzD,MAAA,OAAOC,mBAAa,QAAA,EAAU;AAAA,QAC5B,SAAA,EAAWC,SAAA;AAAA,UAAA,CACT,EAAA,GAAA,QAAA,CAAS,UAAT,IAAA,GAAA,MAAA,GAAA,EAAA,CAAgB,SAAA;AAAA,UAChB,KAAA;AAAA,UACA,gBAAgB,OAAO,CAAA;AAAA,SACzB;AAAA;AAAA,QAEA,WAAA,EAAa,IAAA;AAAA,QACb,GAAG;AAAA,OACJ,CAAA;AAAA,IACH;AACA,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN;AAAA;AAAA;AAAA,iDAAA;AAAA,KAGF;AACA,IAAA,OAAO,QAAA;AAAA,EACT;AAEA,EAAA,IAAI,mBAAmB,OAAA,EAAS;AAC9B,IAAA,uBACEC,cAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAWD,SAAA,CAAK,eAAA,EAAiB,KAAA,EAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAE,CAAA;AAAA,QACjE,WAAA,EAAW,IAAA;AAAA,QACV,GAAG,cAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AAEA,EAAA,OAAO,QAAA;AACT;;;;"}
1
+ {"version":3,"file":"ThemeApplicator.js","sources":["../src/salt-provider/ThemeApplicator.tsx"],"sourcesContent":["import { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport {\n cloneElement,\n type HTMLAttributes,\n isValidElement,\n type ReactNode,\n} from \"react\";\nimport type {\n Accent,\n ActionFont,\n Corner,\n Density,\n HeadingFont,\n Mode,\n ThemeName,\n} from \"../theme/index\";\nimport { useId } from \"../utils/useId\";\nimport { useIsomorphicLayoutEffect } from \"../utils/useIsomorphicLayoutEffect\";\n\nexport interface ThemeApplicatorProps {\n /**\n * Either \"root\", \"scope\" or \"child\".\n * Specifies the location of salt theme class and attributes should be applied to.\n *\n * Defaults to \"root\" for a root provider, otherwise \"scope\".\n */\n applyClassesTo: \"root\" | \"scope\" | \"child\";\n /**\n * Either \"high\", \"medium\", \"low\", \"touch\" or \"mobile\".\n * Determines the amount of content that can fit on a screen based on the size and spacing of components.\n * Refer to [density](https://www.saltdesignsystem.com/salt/foundations/density) doc for more detail.\n *\n * @default \"medium\"\n */\n density: Density;\n /**\n * A string. Specifies custom theme name(s) you want to apply, similar to `className`.\n */\n theme: ThemeName;\n /**\n * Either \"light\" or \"dark\". Enable the color palette to change from light to dark.\n * Refer to [modes](https://www.saltdesignsystem.com/salt/foundations/modes) doc for more detail.\n *\n * @default \"light\"\n */\n mode: Mode;\n /**\n * Either \"sharp\" or \"rounded\".\n * Determines selected components corner radius.\n * @default \"sharp\"\n */\n corner?: Corner;\n /**\n * Either \"Open Sans\" or \"Amplitude\".\n * Determines font family of display and heading text.\n * @default \"Open Sans\"\n */\n headingFont?: HeadingFont;\n /**\n * Either \"blue\" or \"teal\".\n * Determines accent color used across components, e.g. Accent Button, List, Calendar.\n * @default \"blue\"\n */\n accent?: Accent;\n /**\n * Either \"Open Sans\" or \"Amplitude\".\n * Determines font family of action components, mostly Buttons.\n * @default \"Open Sans\"\n */\n actionFont?: ActionFont;\n children?: ReactNode;\n}\n\nconst providerSymbol = Symbol.for(\"salt-provider\");\n\nexport function ThemeApplicator({\n applyClassesTo,\n children,\n density,\n mode,\n theme,\n corner,\n headingFont,\n accent,\n actionFont,\n}: ThemeApplicatorProps) {\n const targetWindow = useWindow();\n\n const providerId = useId();\n\n useIsomorphicLayoutEffect(() => {\n if (applyClassesTo !== \"root\" || !targetWindow || !providerId) return;\n\n const targetDocument: Document & { [providerSymbol]?: string } =\n targetWindow.document;\n\n // Claim the document if no other provider has already. The symbol is used so the lock isn't enumerable and guarantees it won't clash with anything else.\n if (!targetDocument[providerSymbol]) {\n targetDocument[providerSymbol] = providerId;\n }\n\n if (providerId !== targetDocument[providerSymbol]) {\n console.warn(\n \"Multiple providers targeting the same window. There can be only one level root level SaltProvider per window.\",\n );\n return;\n }\n\n const themeNames = theme.split(\" \");\n\n // add the styles we want to apply\n targetDocument.documentElement.classList.add(\n ...themeNames,\n `salt-density-${density}`,\n );\n targetDocument.documentElement.dataset.mode = mode;\n\n // Theme Next\n if (corner) targetDocument.documentElement.dataset.corner = corner;\n if (headingFont)\n targetDocument.documentElement.dataset.headingFont = headingFont;\n if (accent) targetDocument.documentElement.dataset.accent = accent;\n if (actionFont)\n targetDocument.documentElement.dataset.actionFont = actionFont;\n\n return () => {\n // Delete lock\n delete targetDocument[providerSymbol];\n\n // When unmounting/remounting, remove the applied styles from the root\n targetDocument.documentElement.classList.remove(\n ...themeNames,\n `salt-density-${density}`,\n );\n targetDocument.documentElement.dataset.mode = undefined;\n\n // Theme Next\n delete targetDocument.documentElement.dataset.corner;\n delete targetDocument.documentElement.dataset.headingFont;\n delete targetDocument.documentElement.dataset.accent;\n delete targetDocument.documentElement.dataset.actionFont;\n };\n }, [\n providerId,\n applyClassesTo,\n density,\n mode,\n theme,\n targetWindow,\n corner,\n headingFont,\n accent,\n actionFont,\n ]);\n\n const themeNextProps = {\n \"data-corner\": corner,\n \"data-heading-font\": headingFont,\n \"data-accent\": accent,\n \"data-action-font\": actionFont,\n };\n\n if (applyClassesTo === \"child\") {\n if (isValidElement<HTMLAttributes<HTMLElement>>(children)) {\n return cloneElement(children, {\n className: clsx(\n children.props?.className,\n theme,\n `salt-density-${density}`,\n ),\n // @ts-expect-error\n \"data-mode\": mode,\n ...themeNextProps,\n });\n }\n console.warn(\n `\\nSaltProvider can only apply CSS classes for theming to a single nested child element of the SaltProvider.\n Either wrap elements with a single container or consider removing the applyClassesToChild prop, in which case a\n div element will wrap your child elements`,\n );\n return children;\n }\n\n if (applyClassesTo === \"scope\") {\n return (\n <div\n className={clsx(\"salt-provider\", theme, `salt-density-${density}`)}\n data-mode={mode}\n {...themeNextProps}\n >\n {children}\n </div>\n );\n }\n\n return children;\n}\n"],"names":["useWindow","useId","useIsomorphicLayoutEffect","isValidElement","cloneElement","clsx","jsx"],"mappings":";;;;;;;;;AA0EA,MAAM,cAAA,GAAiB,MAAA,CAAO,GAAA,CAAI,eAAe,CAAA;AAE1C,SAAS,eAAA,CAAgB;AAAA,EAC9B,cAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAyB;AAtFzB,EAAA,IAAA,EAAA;AAuFE,EAAA,MAAM,eAAeA,gBAAA,EAAU;AAE/B,EAAA,MAAM,aAAaC,WAAA,EAAM;AAEzB,EAAAC,mDAAA,CAA0B,MAAM;AAC9B,IAAA,IAAI,cAAA,KAAmB,MAAA,IAAU,CAAC,YAAA,IAAgB,CAAC,UAAA,EAAY;AAE/D,IAAA,MAAM,iBACJ,YAAA,CAAa,QAAA;AAGf,IAAA,IAAI,CAAC,cAAA,CAAe,cAAc,CAAA,EAAG;AACnC,MAAA,cAAA,CAAe,cAAc,CAAA,GAAI,UAAA;AAAA,IACnC;AAEA,IAAA,IAAI,UAAA,KAAe,cAAA,CAAe,cAAc,CAAA,EAAG;AACjD,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN;AAAA,OACF;AACA,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,UAAA,GAAa,KAAA,CAAM,KAAA,CAAM,GAAG,CAAA;AAGlC,IAAA,cAAA,CAAe,gBAAgB,SAAA,CAAU,GAAA;AAAA,MACvC,GAAG,UAAA;AAAA,MACH,gBAAgB,OAAO,CAAA;AAAA,KACzB;AACA,IAAA,cAAA,CAAe,eAAA,CAAgB,QAAQ,IAAA,GAAO,IAAA;AAG9C,IA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AS;AAC9B,IAAA,IAAIC,oBAAA,CAA4C,QAAQ,CAAA,EAAG;AACzD,MAAA,OAAOC,mBAAa,QAAA,EAAU;AAAA,QAC5B,SAAA,EAAWC,SAAA;AAAA,UAAA,CACT,EAAA,GAAA,QAAA,CAAS,UAAT,IAAA,GAAA,MAAA,GAAA,EAAA,CAAgB,SAAA;AAAA,UAChB,KAAA;AAAA,UACA,gBAAgB,OAAO,CAAA;AAAA,SACzB;AAAA;AAAA,QAEA,WAAA,EAAa,IAAA;AAAA,QACb,GAAG;AAAA,OACJ,CAAA;AAAA,IACH;AACA,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN;AAAA;AAAA;AAAA,iDAAA;AAAA,KAGF;AACA,IAAA,OAAO,QAAA;AAAA,EACT;AAEA,EAAA,IAAI,mBAAmB,OAAA,EAAS;AAC9B,IAAA,uBACEC,cAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,WAAWD,SAAA,CAAK,eAAA,EAAiB,KAAA,EAAO,CAAA,aAAA,EAAgB,OAAO,CAAA,CAAE,CAAA;AAAA,QACjE,WAAA,EAAW,IAAA;AAAA,QACV,GAAG,cAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AAEA,EAAA,OAAO,QAAA;AACT;;;;"}
@@ -15,19 +15,22 @@ const sizeAndStrokeWidthMapping = {
15
15
  high: { width: 12, strokeWidth: 2 },
16
16
  medium: { width: 12, strokeWidth: 2 },
17
17
  low: { width: 14, strokeWidth: 2 },
18
- touch: { width: 16, strokeWidth: 2 }
18
+ touch: { width: 16, strokeWidth: 2 },
19
+ mobile: { width: 16, strokeWidth: 2 }
19
20
  },
20
21
  medium: {
21
22
  high: { width: 20, strokeWidth: 2 },
22
23
  medium: { width: 28, strokeWidth: 4 },
23
24
  low: { width: 36, strokeWidth: 6 },
24
- touch: { width: 44, strokeWidth: 8 }
25
+ touch: { width: 44, strokeWidth: 8 },
26
+ mobile: { width: 44, strokeWidth: 8 }
25
27
  },
26
28
  large: {
27
29
  high: { width: 40, strokeWidth: 2 },
28
30
  medium: { width: 56, strokeWidth: 4 },
29
31
  low: { width: 72, strokeWidth: 6 },
30
- touch: { width: 88, strokeWidth: 8 }
32
+ touch: { width: 88, strokeWidth: 8 },
33
+ mobile: { width: 88, strokeWidth: 8 }
31
34
  }
32
35
  };
33
36
  const SpinnerSVG = ({
@@ -1 +1 @@
1
- {"version":3,"file":"SpinnerSVG.js","sources":["../src/spinner/svgSpinners/SpinnerSVG.tsx"],"sourcesContent":["import type { SVGAttributes } from \"react\";\nimport type { Density } from \"../../theme\";\nimport { makePrefixer } from \"../../utils\";\nimport type { SpinnerSVGSize } from \"../Spinner\";\n\nconst withBaseName = makePrefixer(\"saltSpinner\");\n\ninterface SpinnerProps {\n id?: string;\n rest?: Omit<SVGAttributes<SVGSVGElement>, \"id\">;\n size: SpinnerSVGSize;\n density: Density;\n}\n\nconst sizeAndStrokeWidthMapping = {\n small: {\n high: { width: 12, strokeWidth: 2 },\n medium: { width: 12, strokeWidth: 2 },\n low: { width: 14, strokeWidth: 2 },\n touch: { width: 16, strokeWidth: 2 },\n },\n medium: {\n high: { width: 20, strokeWidth: 2 },\n medium: { width: 28, strokeWidth: 4 },\n low: { width: 36, strokeWidth: 6 },\n touch: { width: 44, strokeWidth: 8 },\n },\n large: {\n high: { width: 40, strokeWidth: 2 },\n medium: { width: 56, strokeWidth: 4 },\n low: { width: 72, strokeWidth: 6 },\n touch: { width: 88, strokeWidth: 8 },\n },\n};\n\nexport const SpinnerSVG = ({\n id = \"svg-spinner\",\n rest,\n size,\n density,\n}: SpinnerProps) => {\n const { width, strokeWidth } = sizeAndStrokeWidthMapping[size][density];\n const radius = (width - strokeWidth) / 2;\n\n return (\n <svg\n className={withBaseName(\"spinner\")}\n viewBox={`0 0 ${width} ${width}`}\n id={id}\n {...rest}\n >\n <defs>\n <linearGradient id={`${id}-1`} x1=\"0\" y1=\"0\" x2=\"100%\" y2=\"0\">\n <stop\n className={withBaseName(\"gradientStop\")}\n offset=\"15%\"\n stopOpacity=\"1\"\n />\n <stop\n className={withBaseName(\"gradientStop\")}\n offset=\"100%\"\n stopOpacity=\"0\"\n />\n </linearGradient>\n </defs>\n <g fill=\"none\">\n {/* \n This first path draws the top half of the circle without a gradient. \n It starts from the right end, moves in a circular arc, and ends at the left end.\n */}\n <path\n d={`M${width - strokeWidth / 2},${\n width / 2\n } a${radius},${radius} 0 1,0 -${width - strokeWidth},0`}\n stroke=\"var(--saltSpinner-gradient-color, var(--salt-accent-background)\"\n strokeWidth=\"var(--spinner-strokeWidth)\"\n fill=\"none\"\n />\n {/* \n This second path draws the left half of the circle with a gradient that transitions \n from opaque on the left to transparent on the right.\n It starts from the top-center, moves in a circular arc, and ends at the bottom-center.\n */}\n <path\n d={`M${width / 2},${strokeWidth / 2} a${radius},${radius} 0 1,0 0,${\n width - strokeWidth\n }`}\n stroke={`url(#${id}-1)`}\n strokeWidth=\"var(--spinner-strokeWidth)\"\n fill=\"none\"\n />\n </g>\n </svg>\n );\n};\n"],"names":["makePrefixer","jsxs","jsx"],"mappings":";;;;;;;;;;;AAKA,MAAM,YAAA,GAAeA,0BAAa,aAAa,CAAA;AAS/C,MAAM,yBAAA,GAA4B;AAAA,EAChC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IAClC,MAAA,EAAQ,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IACpC,GAAA,EAAK,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IACjC,KAAA,EAAO,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA;AAAE,GACrC;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IAClC,MAAA,EAAQ,EAAE,KAAA,EAAO,EAAA,EAAI,aAA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innerSVG.js","sources":["../src/spinner/svgSpinners/SpinnerSVG.tsx"],"sourcesContent":["import type { SVGAttributes } from \"react\";\nimport type { Density } from \"../../theme\";\nimport { makePrefixer } from \"../../utils\";\nimport type { SpinnerSVGSize } from \"../Spinner\";\n\nconst withBaseName = makePrefixer(\"saltSpinner\");\n\ninterface SpinnerProps {\n id?: string;\n rest?: Omit<SVGAttributes<SVGSVGElement>, \"id\">;\n size: SpinnerSVGSize;\n density: Density;\n}\n\nconst sizeAndStrokeWidthMapping = {\n small: {\n high: { width: 12, strokeWidth: 2 },\n medium: { width: 12, strokeWidth: 2 },\n low: { width: 14, strokeWidth: 2 },\n touch: { width: 16, strokeWidth: 2 },\n mobile: { width: 16, strokeWidth: 2 },\n },\n medium: {\n high: { width: 20, strokeWidth: 2 },\n medium: { width: 28, strokeWidth: 4 },\n low: { width: 36, strokeWidth: 6 },\n touch: { width: 44, strokeWidth: 8 },\n mobile: { width: 44, strokeWidth: 8 },\n },\n large: {\n high: { width: 40, strokeWidth: 2 },\n medium: { width: 56, strokeWidth: 4 },\n low: { width: 72, strokeWidth: 6 },\n touch: { width: 88, strokeWidth: 8 },\n mobile: { width: 88, strokeWidth: 8 },\n },\n};\n\nexport const SpinnerSVG = ({\n id = \"svg-spinner\",\n rest,\n size,\n density,\n}: SpinnerProps) => {\n const { width, strokeWidth } = sizeAndStrokeWidthMapping[size][density];\n const radius = (width - strokeWidth) / 2;\n\n return (\n <svg\n className={withBaseName(\"spinner\")}\n viewBox={`0 0 ${width} ${width}`}\n id={id}\n {...rest}\n >\n <defs>\n <linearGradient id={`${id}-1`} x1=\"0\" y1=\"0\" x2=\"100%\" y2=\"0\">\n <stop\n className={withBaseName(\"gradientStop\")}\n offset=\"15%\"\n stopOpacity=\"1\"\n />\n <stop\n className={withBaseName(\"gradientStop\")}\n offset=\"100%\"\n stopOpacity=\"0\"\n />\n </linearGradient>\n </defs>\n <g fill=\"none\">\n {/*\n This first path draws the top half of the circle without a gradient.\n It starts from the right end, moves in a circular arc, and ends at the left end.\n */}\n <path\n d={`M${width - strokeWidth / 2},${\n width / 2\n } a${radius},${radius} 0 1,0 -${width - strokeWidth},0`}\n stroke=\"var(--saltSpinner-gradient-color, var(--salt-accent-background)\"\n strokeWidth=\"var(--spinner-strokeWidth)\"\n fill=\"none\"\n />\n {/*\n This second path draws the left half of the circle with a gradient that transitions\n from opaque on the left to transparent on the right.\n It starts from the top-center, moves in a circular arc, and ends at the bottom-center.\n */}\n <path\n d={`M${width / 2},${strokeWidth / 2} a${radius},${radius} 0 1,0 0,${\n width - strokeWidth\n }`}\n stroke={`url(#${id}-1)`}\n strokeWidth=\"var(--spinner-strokeWidth)\"\n fill=\"none\"\n />\n </g>\n </svg>\n );\n};\n"],"names":["makePrefixer","jsxs","jsx"],"mappings":";;;;;;;;;;;AAKA,MAAM,YAAA,GAAeA,0BAAa,aAAa,CAAA;AAS/C,MAAM,yBAAA,GAA4B;AAAA,EAChC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IAClC,MAAA,EAAQ,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IACpC,GAAA,EAAK,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IACjC,KAAA,EAAO,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IACnC,MAAA,EAAQ,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA;AAAE,GACtC;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IAClC,MAAA,EAAQ,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IACpC,GAAA,EAAK,EAAE,KAAA,EAAO,EAAA,EAAI,aAAa,CAAA,EAAE;AAAA,IACjC,KAAA,EAA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ACF;AAEJ;;;;"}
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styles = require('@salt-ds/styles');
5
+ var window = require('@salt-ds/window');
6
+ var clsx = require('clsx');
7
+ var React = require('react');
8
+ var Table$1 = require('./Table.js');
9
+ var Table = require('./Table.css.js');
10
+
11
+ const TBody = React.forwardRef(
12
+ function TBody2({ children, className, ...rest }, ref) {
13
+ const targetWindow = window.useWindow();
14
+ styles.useComponentCssInjection({
15
+ testId: "salt-table-tbody",
16
+ css: Table,
17
+ window: targetWindow
18
+ });
19
+ return /* @__PURE__ */ jsxRuntime.jsx(
20
+ "tbody",
21
+ {
22
+ ref,
23
+ className: clsx.clsx(Table$1.withTableBaseName("tbody"), className),
24
+ ...rest,
25
+ children
26
+ }
27
+ );
28
+ }
29
+ );
30
+
31
+ exports.TBody = TBody;
32
+ //# sourceMappingURL=TBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TBody.js","sources":["../src/table/TBody.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TBodyProps extends ComponentPropsWithoutRef<\"tbody\"> {}\n\nexport const TBody = forwardRef<HTMLTableSectionElement, TBodyProps>(\n function TBody({ children, className, ...rest }, ref) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-tbody\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <tbody\n ref={ref}\n className={clsx(withTableBaseName(\"tbody\"), className)}\n {...rest}\n >\n {children}\n </tbody>\n );\n },\n);\n"],"names":["forwardRef","TBody","useWindow","useComponentCssInjection","tableCss","jsx","clsx","withTableBaseName"],"mappings":";;;;;;;;;;AAUO,MAAM,KAAA,GAAQA,gBAAA;AAAA,EACnB,SAASC,OAAM,EAAE,QAAA,EAAU,WAAW,GAAG,IAAA,IAAQ,GAAA,EAAK;AACpD,IAAA,MAAM,eAAeC,gBAAA,EAAU;AAC/B,IAAAC,+BAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,kBAAA;AAAA,MACR,GAAA,EAAKC,KAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,uBACEC,cAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAWC,SAAA,CAAKC,yBAAA,CAAkB,OAAO,GAAG,SAAS,CAAA;AAAA,QACpD,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styles = require('@salt-ds/styles');
5
+ var window = require('@salt-ds/window');
6
+ var clsx = require('clsx');
7
+ var React = require('react');
8
+ var Table$1 = require('./Table.js');
9
+ var Table = require('./Table.css.js');
10
+
11
+ const TD = React.forwardRef(function TD2({ children, className, textAlign = "left", ...rest }, ref) {
12
+ const targetWindow = window.useWindow();
13
+ styles.useComponentCssInjection({
14
+ testId: "salt-table-td",
15
+ css: Table,
16
+ window: targetWindow
17
+ });
18
+ return /* @__PURE__ */ jsxRuntime.jsx(
19
+ "td",
20
+ {
21
+ ref,
22
+ className: clsx(
23
+ Table$1.withTableBaseName("td"),
24
+ Table$1.withTableBaseName("td", "align", textAlign),
25
+ className
26
+ ),
27
+ ...rest,
28
+ children
29
+ }
30
+ );
31
+ });
32
+
33
+ exports.TD = TD;
34
+ //# sourceMappingURL=TD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TD.js","sources":["../src/table/TD.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TDProps extends ComponentPropsWithoutRef<\"td\"> {\n /**\n * Specifies the alignment of the text within the `TD`.\n *\n * @default \"left\"\n */\n textAlign?: \"left\" | \"right\";\n}\n\nexport const TD = forwardRef<HTMLTableCellElement, TDProps>(function TD(\n { children, className, textAlign = \"left\", ...rest },\n ref,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-td\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <td\n ref={ref}\n className={clsx(\n withTableBaseName(\"td\"),\n withTableBaseName(\"td\", \"align\", textAlign),\n className,\n )}\n {...rest}\n >\n {children}\n </td>\n );\n});\n"],"names":["forwardRef","TD","useWindow","useComponentCssInjection","tableCss","jsx","withTableBaseName"],"mappings":";;;;;;;;;;AAiBO,MAAM,EAAA,GAAKA,gBAAA,CAA0C,SAASC,GAAAA,CACnE,EAAE,QAAA,EAAU,SAAA,EAAW,SAAA,GAAY,MAAA,EAAQ,GAAG,IAAA,EAAK,EACnD,GAAA,EACA;AACA,EAAA,MAAM,eAAeC,gBAAA,EAAU;AAC/B,EAAAC,+BAAA,CAAyB;AAAA,IACvB,MAAA,EAAQ,eAAA;AAAA,IACR,GAAA,EAAKC,KAAA;AAAA,IACL,MAAA,EAAQ;AAAA,GACT,CAAA;AAED,EAAA,uBACEC,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,IAAA;AAAA,QACTC,0BAAkB,IAAI,CAAA;AAAA,QACtBA,yBAAA,CAAkB,IAAA,EAAM,OAAA,EAAS,SAAS,CAAA;AAAA,QAC1C;AAAA,OACF;AAAA,MACC,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styles = require('@salt-ds/styles');
5
+ var window = require('@salt-ds/window');
6
+ var clsx = require('clsx');
7
+ var React = require('react');
8
+ var Table$1 = require('./Table.js');
9
+ var Table = require('./Table.css.js');
10
+
11
+ const TFoot = React.forwardRef(
12
+ function TFoot2({
13
+ children,
14
+ className,
15
+ sticky = false,
16
+ variant,
17
+ divider = "primary",
18
+ ...rest
19
+ }, ref) {
20
+ const targetWindow = window.useWindow();
21
+ styles.useComponentCssInjection({
22
+ testId: "salt-table-tfoot",
23
+ css: Table,
24
+ window: targetWindow
25
+ });
26
+ return /* @__PURE__ */ jsxRuntime.jsx(
27
+ "tfoot",
28
+ {
29
+ ref,
30
+ className: clsx.clsx(
31
+ Table$1.withTableBaseName("tfoot"),
32
+ { [Table$1.withTableBaseName(`tfoot-${variant}`)]: variant },
33
+ { [Table$1.withTableBaseName("tfoot-sticky")]: sticky },
34
+ { [Table$1.withTableBaseName(`tfoot-divider-${divider}`)]: divider },
35
+ className
36
+ ),
37
+ ...rest,
38
+ children
39
+ }
40
+ );
41
+ }
42
+ );
43
+
44
+ exports.TFoot = TFoot;
45
+ //# sourceMappingURL=TFoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TFoot.js","sources":["../src/table/TFoot.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TFootProps extends ComponentPropsWithoutRef<\"tfoot\"> {\n /**\n * If footer is positioned with sticky styling.\n * @default false\n */\n sticky?: boolean;\n /**\n * Divider styling variant. Defaults to \"primary\";\n * @default primary\n */\n divider?: \"primary\" | \"secondary\" | \"tertiary\" | \"none\";\n /**\n * Styling variant for footer.\n * If undefined, will match variant of parent Table component's variant.\n * @default undefined\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n}\n\nexport const TFoot = forwardRef<HTMLTableSectionElement, TFootProps>(\n function TFoot(\n {\n children,\n className,\n sticky = false,\n variant,\n divider = \"primary\",\n ...rest\n },\n ref,\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-tfoot\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <tfoot\n ref={ref}\n className={clsx(\n withTableBaseName(\"tfoot\"),\n { [withTableBaseName(`tfoot-${variant}`)]: variant },\n { [withTableBaseName(\"tfoot-sticky\")]: sticky },\n { [withTableBaseName(`tfoot-divider-${divider}`)]: divider },\n className,\n )}\n {...rest}\n >\n {children}\n </tfoot>\n );\n },\n);\n"],"names":["forwardRef","TFoot","useWindow","useComponentCssInjection","tableCss","jsx","clsx","withTableBaseName"],"mappings":";;;;;;;;;;AA2BO,MAAM,KAAA,GAAQA,gBAAA;AAAA,EACnB,SAASC,MAAAA,CACP;AAAA,IACE,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA,GAAS,KAAA;AAAA,IACT,OAAA;AAAA,IACA,OAAA,GAAU,SAAA;AAAA,IACV,GAAG;AAAA,KAEL,GAAA,EACA;AACA,IAAA,MAAM,eAAeC,gBAAA,EAAU;AAC/B,IAAAC,+BAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,kBAAA;AAAA,MACR,GAAA,EAAKC,KAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,uBACEC,cAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAWC,SAAA;AAAA,UACTC,0BAAkB,OAAO,CAAA;AAAA,UACzB,EAAE,CAACA,yBAAA,CAAkB,CAAA,MAAA,EAAS,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UACnD,EAAE,CAACA,yBAAA,CAAkB,cAAc,CAAC,GAAG,MAAA,EAAO;AAAA,UAC9C,EAAE,CAACA,yBAAA,CAAkB,CAAA,cAAA,EAAiB,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UAC3D;AAAA,SACF;AAAA,QACC,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styles = require('@salt-ds/styles');
5
+ var window = require('@salt-ds/window');
6
+ var clsx = require('clsx');
7
+ var React = require('react');
8
+ var Table$1 = require('./Table.js');
9
+ var Table = require('./Table.css.js');
10
+
11
+ const TH = React.forwardRef(function TH2({ children, className, textAlign = "left", ...rest }, ref) {
12
+ const targetWindow = window.useWindow();
13
+ styles.useComponentCssInjection({
14
+ testId: "salt-table-th",
15
+ css: Table,
16
+ window: targetWindow
17
+ });
18
+ return /* @__PURE__ */ jsxRuntime.jsx(
19
+ "th",
20
+ {
21
+ ref,
22
+ className: clsx.clsx(
23
+ Table$1.withTableBaseName("th"),
24
+ Table$1.withTableBaseName("th", "align", textAlign),
25
+ className
26
+ ),
27
+ ...rest,
28
+ children
29
+ }
30
+ );
31
+ });
32
+
33
+ exports.TH = TH;
34
+ //# sourceMappingURL=TH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TH.js","sources":["../src/table/TH.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface THProps extends ComponentPropsWithoutRef<\"th\"> {\n /**\n * Specifies the alignment of the text within the `TH`.\n *\n * @default \"left\"\n */\n textAlign?: \"left\" | \"right\";\n}\n\nexport const TH = forwardRef<HTMLTableCellElement, THProps>(function TH(\n { children, className, textAlign = \"left\", ...rest },\n ref,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-th\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <th\n ref={ref}\n className={clsx(\n withTableBaseName(\"th\"),\n withTableBaseName(\"th\", \"align\", textAlign),\n className,\n )}\n {...rest}\n >\n {children}\n </th>\n );\n});\n"],"names":["forwardRef","TH","useWindow","useComponentCssInjection","tableCss","jsx","clsx","withTableBaseName"],"mappings":";;;;;;;;;;AAiBO,MAAM,EAAA,GAAKA,gBAAA,CAA0C,SAASC,GAAAA,CACnE,EAAE,QAAA,EAAU,SAAA,EAAW,SAAA,GAAY,MAAA,EAAQ,GAAG,IAAA,EAAK,EACnD,GAAA,EACA;AACA,EAAA,MAAM,eAAeC,gBAAA,EAAU;AAC/B,EAAAC,+BAAA,CAAyB;AAAA,IACvB,MAAA,EAAQ,eAAA;AAAA,IACR,GAAA,EAAKC,KAAA;AAAA,IACL,MAAA,EAAQ;AAAA,GACT,CAAA;AAED,EAAA,uBACEC,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAWC,SAAA;AAAA,QACTC,0BAAkB,IAAI,CAAA;AAAA,QACtBA,yBAAA,CAAkB,IAAA,EAAM,OAAA,EAAS,SAAS,CAAA;AAAA,QAC1C;AAAA,OACF;AAAA,MACC,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styles = require('@salt-ds/styles');
5
+ var window = require('@salt-ds/window');
6
+ var clsx = require('clsx');
7
+ var React = require('react');
8
+ var Table$1 = require('./Table.js');
9
+ var Table = require('./Table.css.js');
10
+
11
+ const THead = React.forwardRef(
12
+ function THead2({
13
+ children,
14
+ className,
15
+ sticky = false,
16
+ variant,
17
+ divider = "primary",
18
+ ...rest
19
+ }, ref) {
20
+ const targetWindow = window.useWindow();
21
+ styles.useComponentCssInjection({
22
+ testId: "salt-table-thead",
23
+ css: Table,
24
+ window: targetWindow
25
+ });
26
+ return /* @__PURE__ */ jsxRuntime.jsx(
27
+ "thead",
28
+ {
29
+ ref,
30
+ className: clsx.clsx(
31
+ Table$1.withTableBaseName("thead"),
32
+ { [Table$1.withTableBaseName(`thead-${variant}`)]: variant },
33
+ { [Table$1.withTableBaseName("thead-sticky")]: sticky },
34
+ { [Table$1.withTableBaseName(`thead-divider-${divider}`)]: divider },
35
+ className
36
+ ),
37
+ ...rest,
38
+ children
39
+ }
40
+ );
41
+ }
42
+ );
43
+
44
+ exports.THead = THead;
45
+ //# sourceMappingURL=THead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"THead.js","sources":["../src/table/THead.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface THeadProps extends ComponentPropsWithoutRef<\"thead\"> {\n /**\n * If header is positioned with sticky styling.\n * @default false\n */\n sticky?: boolean;\n /**\n * Divider styling variant. Defaults to \"primary\";\n * @default primary\n */\n divider?: \"primary\" | \"secondary\" | \"tertiary\" | \"none\";\n /**\n * Styling variant for header.\n * If undefined, will match variant of parent Table component's variant.\n * @default undefined\n */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n}\n\nexport const THead = forwardRef<HTMLTableSectionElement, THeadProps>(\n function THead(\n {\n children,\n className,\n sticky = false,\n variant,\n divider = \"primary\",\n ...rest\n },\n ref,\n ) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-thead\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <thead\n ref={ref}\n className={clsx(\n withTableBaseName(\"thead\"),\n { [withTableBaseName(`thead-${variant}`)]: variant },\n { [withTableBaseName(\"thead-sticky\")]: sticky },\n { [withTableBaseName(`thead-divider-${divider}`)]: divider },\n className,\n )}\n {...rest}\n >\n {children}\n </thead>\n );\n },\n);\n"],"names":["forwardRef","THead","useWindow","useComponentCssInjection","tableCss","jsx","clsx","withTableBaseName"],"mappings":";;;;;;;;;;AA2BO,MAAM,KAAA,GAAQA,gBAAA;AAAA,EACnB,SAASC,MAAAA,CACP;AAAA,IACE,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA,GAAS,KAAA;AAAA,IACT,OAAA;AAAA,IACA,OAAA,GAAU,SAAA;AAAA,IACV,GAAG;AAAA,KAEL,GAAA,EACA;AACA,IAAA,MAAM,eAAeC,gBAAA,EAAU;AAC/B,IAAAC,+BAAA,CAAyB;AAAA,MACvB,MAAA,EAAQ,kBAAA;AAAA,MACR,GAAA,EAAKC,KAAA;AAAA,MACL,MAAA,EAAQ;AAAA,KACT,CAAA;AAED,IAAA,uBACEC,cAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAWC,SAAA;AAAA,UACTC,0BAAkB,OAAO,CAAA;AAAA,UACzB,EAAE,CAACA,yBAAA,CAAkB,CAAA,MAAA,EAAS,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UACnD,EAAE,CAACA,yBAAA,CAAkB,cAAc,CAAC,GAAG,MAAA,EAAO;AAAA,UAC9C,EAAE,CAACA,yBAAA,CAAkB,CAAA,cAAA,EAAiB,OAAO,CAAA,CAAE,CAAC,GAAG,OAAA,EAAQ;AAAA,UAC3D;AAAA,SACF;AAAA,QACC,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styles = require('@salt-ds/styles');
5
+ var window = require('@salt-ds/window');
6
+ var clsx = require('clsx');
7
+ var React = require('react');
8
+ var Table$1 = require('./Table.js');
9
+ var Table = require('./Table.css.js');
10
+
11
+ const TR = React.forwardRef(function TR2({ children, className, ...rest }, ref) {
12
+ const targetWindow = window.useWindow();
13
+ styles.useComponentCssInjection({
14
+ testId: "salt-table-tr",
15
+ css: Table,
16
+ window: targetWindow
17
+ });
18
+ return /* @__PURE__ */ jsxRuntime.jsx(
19
+ "tr",
20
+ {
21
+ ref,
22
+ className: clsx.clsx(Table$1.withTableBaseName("tr"), className),
23
+ ...rest,
24
+ children
25
+ }
26
+ );
27
+ });
28
+
29
+ exports.TR = TR;
30
+ //# sourceMappingURL=TR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TR.js","sources":["../src/table/TR.tsx"],"sourcesContent":["import { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { clsx } from \"clsx\";\nimport { type ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { withTableBaseName } from \"./Table\";\n\nimport tableCss from \"./Table.css\";\n\nexport interface TRProps extends ComponentPropsWithoutRef<\"tr\"> {}\n\nexport const TR = forwardRef<HTMLTableRowElement, TRProps>(function TR(\n { children, className, ...rest },\n ref,\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-table-tr\",\n css: tableCss,\n window: targetWindow,\n });\n\n return (\n <tr\n ref={ref}\n className={clsx(withTableBaseName(\"tr\"), className)}\n {...rest}\n >\n {children}\n </tr>\n );\n});\n"],"names":["forwardRef","TR","useWindow","useComponentCssInjection","tableCss","jsx","clsx","withTableBaseName"],"mappings":";;;;;;;;;;AAUO,MAAM,EAAA,GAAKA,gBAAA,CAAyC,SAASC,GAAAA,CAClE,EAAE,UAAU,SAAA,EAAW,GAAG,IAAA,EAAK,EAC/B,GAAA,EACA;AACA,EAAA,MAAM,eAAeC,gBAAA,EAAU;AAC/B,EAAAC,+BAAA,CAAyB;AAAA,IACvB,MAAA,EAAQ,eAAA;AAAA,IACR,GAAA,EAAKC,KAAA;AAAA,IACL,MAAA,EAAQ;AAAA,GACT,CAAA;AAED,EAAA,uBACEC,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAWC,SAAA,CAAKC,yBAAA,CAAkB,IAAI,GAAG,SAAS,CAAA;AAAA,MACjD,GAAG,IAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;;;;"}