@spark-ui/components 10.17.2 → 10.17.4

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.
package/dist/docgen.json CHANGED
@@ -115,7 +115,7 @@
115
115
  "name": "className",
116
116
  "declarations": [
117
117
  {
118
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/utils/types.d.ts",
118
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
119
119
  "name": "TypeLiteral"
120
120
  }
121
121
  ],
@@ -129,12 +129,12 @@
129
129
  "description": "The uncontrolled value of the item(s) that should be initially expanded.\n\nTo render a controlled accordion, use the `value` prop instead.",
130
130
  "name": "defaultValue",
131
131
  "parent": {
132
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
132
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
133
133
  "name": "Props"
134
134
  },
135
135
  "declarations": [
136
136
  {
137
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
137
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
138
138
  "name": "Props"
139
139
  }
140
140
  ],
@@ -148,12 +148,12 @@
148
148
  "description": "The controlled value of the item(s) that should be expanded.\n\nTo render an uncontrolled accordion, use the `defaultValue` prop instead.",
149
149
  "name": "value",
150
150
  "parent": {
151
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
151
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
152
152
  "name": "Props"
153
153
  },
154
154
  "declarations": [
155
155
  {
156
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
156
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
157
157
  "name": "Props"
158
158
  }
159
159
  ],
@@ -169,12 +169,12 @@
169
169
  "description": "Allows the browser’s built-in page search to find and expand the panel contents.\n\nOverrides the `keepMounted` prop and uses `hidden=\"until-found\"`\nto hide the element without removing it from the DOM.",
170
170
  "name": "hiddenUntilFound",
171
171
  "parent": {
172
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
172
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
173
173
  "name": "Props"
174
174
  },
175
175
  "declarations": [
176
176
  {
177
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
177
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
178
178
  "name": "Props"
179
179
  }
180
180
  ],
@@ -190,12 +190,12 @@
190
190
  "description": "Whether to keep the element in the DOM while the panel is closed.\nThis prop is ignored when `hiddenUntilFound` is used.",
191
191
  "name": "keepMounted",
192
192
  "parent": {
193
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
193
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
194
194
  "name": "Props"
195
195
  },
196
196
  "declarations": [
197
197
  {
198
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
198
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
199
199
  "name": "Props"
200
200
  }
201
201
  ],
@@ -211,12 +211,12 @@
211
211
  "description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
212
212
  "name": "loop",
213
213
  "parent": {
214
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
214
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
215
215
  "name": "Props"
216
216
  },
217
217
  "declarations": [
218
218
  {
219
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
219
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
220
220
  "name": "Props"
221
221
  }
222
222
  ],
@@ -230,18 +230,18 @@
230
230
  "description": "Event handler called when an accordion item is expanded or collapsed.\nProvides the new value as an argument.",
231
231
  "name": "onValueChange",
232
232
  "parent": {
233
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
233
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
234
234
  "name": "Props"
235
235
  },
236
236
  "declarations": [
237
237
  {
238
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
238
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
239
239
  "name": "Props"
240
240
  }
241
241
  ],
242
242
  "required": false,
243
243
  "type": {
244
- "name": "(value: AccordionValue) => void"
244
+ "name": "(value: AccordionValue, eventDetails: { reason: \"none\"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; }) => void"
245
245
  }
246
246
  },
247
247
  "orientation": {
@@ -251,12 +251,12 @@
251
251
  "description": "The visual orientation of the accordion.\nControls whether roving focus uses left/right or up/down arrow keys.",
252
252
  "name": "orientation",
253
253
  "parent": {
254
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
254
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
255
255
  "name": "Props"
256
256
  },
257
257
  "declarations": [
258
258
  {
259
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
259
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
260
260
  "name": "Props"
261
261
  }
262
262
  ],
@@ -328,7 +328,7 @@
328
328
  "name": "className",
329
329
  "declarations": [
330
330
  {
331
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/utils/types.d.ts",
331
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
332
332
  "name": "TypeLiteral"
333
333
  }
334
334
  ],
@@ -342,12 +342,12 @@
342
342
  "description": "",
343
343
  "name": "value",
344
344
  "parent": {
345
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/item/AccordionItem.d.ts",
345
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/item/AccordionItem.d.ts",
346
346
  "name": "Props"
347
347
  },
348
348
  "declarations": [
349
349
  {
350
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/item/AccordionItem.d.ts",
350
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/item/AccordionItem.d.ts",
351
351
  "name": "Props"
352
352
  }
353
353
  ],
@@ -363,12 +363,12 @@
363
363
  "description": "Whether the component should ignore user interaction.",
364
364
  "name": "disabled",
365
365
  "parent": {
366
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/useCollapsibleRoot.d.ts",
366
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/useCollapsibleRoot.d.ts",
367
367
  "name": "Parameters"
368
368
  },
369
369
  "declarations": [
370
370
  {
371
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/useCollapsibleRoot.d.ts",
371
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/useCollapsibleRoot.d.ts",
372
372
  "name": "Parameters"
373
373
  }
374
374
  ],
@@ -382,12 +382,12 @@
382
382
  "description": "Event handler called when the panel is opened or closed.",
383
383
  "name": "onOpenChange",
384
384
  "parent": {
385
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/useCollapsibleRoot.d.ts",
385
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/useCollapsibleRoot.d.ts",
386
386
  "name": "Parameters"
387
387
  },
388
388
  "declarations": [
389
389
  {
390
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/useCollapsibleRoot.d.ts",
390
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/useCollapsibleRoot.d.ts",
391
391
  "name": "Parameters"
392
392
  }
393
393
  ],
@@ -450,7 +450,7 @@
450
450
  "name": "className",
451
451
  "declarations": [
452
452
  {
453
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/utils/types.d.ts",
453
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
454
454
  "name": "TypeLiteral"
455
455
  }
456
456
  ],
@@ -466,12 +466,12 @@
466
466
  "description": "Allows the browser’s built-in page search to find and expand the panel contents.\n\nOverrides the `keepMounted` prop and uses `hidden=\"until-found\"`\nto hide the element without removing it from the DOM.",
467
467
  "name": "hiddenUntilFound",
468
468
  "parent": {
469
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
469
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
470
470
  "name": "Props"
471
471
  },
472
472
  "declarations": [
473
473
  {
474
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
474
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
475
475
  "name": "Props"
476
476
  }
477
477
  ],
@@ -487,12 +487,12 @@
487
487
  "description": "Whether to keep the element in the DOM while the panel is closed.\nThis prop is ignored when `hiddenUntilFound` is used.",
488
488
  "name": "keepMounted",
489
489
  "parent": {
490
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
490
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
491
491
  "name": "Props"
492
492
  },
493
493
  "declarations": [
494
494
  {
495
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/root/AccordionRoot.d.ts",
495
+ "fileName": "spark-web/node_modules/@base-ui-components/react/accordion/root/AccordionRoot.d.ts",
496
496
  "name": "Props"
497
497
  }
498
498
  ],
@@ -603,7 +603,7 @@
603
603
  "name": "className",
604
604
  "declarations": [
605
605
  {
606
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/utils/types.d.ts",
606
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
607
607
  "name": "TypeLiteral"
608
608
  }
609
609
  ],
@@ -619,13 +619,13 @@
619
619
  "description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (e.g. `<div>`).",
620
620
  "name": "nativeButton",
621
621
  "parent": {
622
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/trigger/AccordionTrigger.d.ts",
623
- "name": "Props"
622
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
623
+ "name": "NativeButtonProps"
624
624
  },
625
625
  "declarations": [
626
626
  {
627
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/accordion/trigger/AccordionTrigger.d.ts",
628
- "name": "Props"
627
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
628
+ "name": "NativeButtonProps"
629
629
  }
630
630
  ],
631
631
  "required": false,
@@ -6059,10 +6059,10 @@
6059
6059
  "name": "string"
6060
6060
  }
6061
6061
  },
6062
- "__@hasInstance@3205": {
6062
+ "__@hasInstance@3232": {
6063
6063
  "defaultValue": null,
6064
6064
  "description": "Determines whether the given value inherits from this function if this function was used\nas a constructor function.\n\nA constructor function can control which objects are recognized as its instances by\n'instanceof' by overriding this method.",
6065
- "name": "__@hasInstance@3205",
6065
+ "name": "__@hasInstance@3232",
6066
6066
  "parent": {
6067
6067
  "fileName": "spark-web/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts",
6068
6068
  "name": "Function"
@@ -6078,10 +6078,10 @@
6078
6078
  "name": "(value: any) => boolean"
6079
6079
  }
6080
6080
  },
6081
- "__@metadata@3207": {
6081
+ "__@metadata@3234": {
6082
6082
  "defaultValue": null,
6083
6083
  "description": "",
6084
- "name": "__@metadata@3207",
6084
+ "name": "__@metadata@3234",
6085
6085
  "parent": {
6086
6086
  "fileName": "spark-web/node_modules/typescript/lib/lib.esnext.decorators.d.ts",
6087
6087
  "name": "Function"
@@ -13670,12 +13670,12 @@
13670
13670
  "description": "Allows the browser’s built-in page search to find and expand the panel contents.\n\nOverrides the `keepMounted` prop and uses `hidden=\"until-found\"`\nto hide the element without removing it from the DOM.",
13671
13671
  "name": "hiddenUntilFound",
13672
13672
  "parent": {
13673
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/panel/CollapsiblePanel.d.ts",
13673
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/panel/CollapsiblePanel.d.ts",
13674
13674
  "name": "Props"
13675
13675
  },
13676
13676
  "declarations": [
13677
13677
  {
13678
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/panel/CollapsiblePanel.d.ts",
13678
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/panel/CollapsiblePanel.d.ts",
13679
13679
  "name": "Props"
13680
13680
  }
13681
13681
  ],
@@ -13691,12 +13691,12 @@
13691
13691
  "description": "Whether to keep the element in the DOM while the panel is hidden.\nThis prop is ignored when `hiddenUntilFound` is used.",
13692
13692
  "name": "keepMounted",
13693
13693
  "parent": {
13694
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/panel/CollapsiblePanel.d.ts",
13694
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/panel/CollapsiblePanel.d.ts",
13695
13695
  "name": "Props"
13696
13696
  },
13697
13697
  "declarations": [
13698
13698
  {
13699
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/panel/CollapsiblePanel.d.ts",
13699
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/panel/CollapsiblePanel.d.ts",
13700
13700
  "name": "Props"
13701
13701
  }
13702
13702
  ],
@@ -13711,7 +13711,7 @@
13711
13711
  "name": "className",
13712
13712
  "declarations": [
13713
13713
  {
13714
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/utils/types.d.ts",
13714
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
13715
13715
  "name": "TypeLiteral"
13716
13716
  }
13717
13717
  ],
@@ -13726,7 +13726,7 @@
13726
13726
  "name": "render",
13727
13727
  "declarations": [
13728
13728
  {
13729
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/utils/types.d.ts",
13729
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
13730
13730
  "name": "TypeLiteral"
13731
13731
  }
13732
13732
  ],
@@ -13767,12 +13767,12 @@
13767
13767
  "description": "Whether the collapsible panel is currently open.\n\nTo render an uncontrolled collapsible, use the `defaultOpen` prop instead.",
13768
13768
  "name": "open",
13769
13769
  "parent": {
13770
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13770
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13771
13771
  "name": "Props"
13772
13772
  },
13773
13773
  "declarations": [
13774
13774
  {
13775
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13775
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13776
13776
  "name": "Props"
13777
13777
  }
13778
13778
  ],
@@ -13788,12 +13788,12 @@
13788
13788
  "description": "Whether the collapsible panel is initially open.\n\nTo render a controlled collapsible, use the `open` prop instead.",
13789
13789
  "name": "defaultOpen",
13790
13790
  "parent": {
13791
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13791
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13792
13792
  "name": "Props"
13793
13793
  },
13794
13794
  "declarations": [
13795
13795
  {
13796
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13796
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13797
13797
  "name": "Props"
13798
13798
  }
13799
13799
  ],
@@ -13807,12 +13807,12 @@
13807
13807
  "description": "Event handler called when the panel is opened or closed.",
13808
13808
  "name": "onOpenChange",
13809
13809
  "parent": {
13810
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13810
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13811
13811
  "name": "Props"
13812
13812
  },
13813
13813
  "declarations": [
13814
13814
  {
13815
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13815
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13816
13816
  "name": "Props"
13817
13817
  }
13818
13818
  ],
@@ -13828,12 +13828,12 @@
13828
13828
  "description": "Whether the component should ignore user interaction.",
13829
13829
  "name": "disabled",
13830
13830
  "parent": {
13831
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13831
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13832
13832
  "name": "Props"
13833
13833
  },
13834
13834
  "declarations": [
13835
13835
  {
13836
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13836
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13837
13837
  "name": "Props"
13838
13838
  }
13839
13839
  ],
@@ -13847,12 +13847,12 @@
13847
13847
  "description": "",
13848
13848
  "name": "render",
13849
13849
  "parent": {
13850
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13850
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13851
13851
  "name": "Props"
13852
13852
  },
13853
13853
  "declarations": [
13854
13854
  {
13855
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/collapsible/root/CollapsibleRoot.d.ts",
13855
+ "fileName": "spark-web/node_modules/@base-ui-components/react/collapsible/root/CollapsibleRoot.d.ts",
13856
13856
  "name": "Props"
13857
13857
  }
13858
13858
  ],
@@ -13867,7 +13867,7 @@
13867
13867
  "name": "className",
13868
13868
  "declarations": [
13869
13869
  {
13870
- "fileName": "spark-web/node_modules/@base-ui-components/react/cjs/utils/types.d.ts",
13870
+ "fileName": "spark-web/node_modules/@base-ui-components/react/utils/types.d.ts",
13871
13871
  "name": "TypeLiteral"
13872
13872
  }
13873
13873
  ],
package/dist/tag/index.js CHANGED
@@ -195,7 +195,7 @@ var tintedVariants = [
195
195
  // src/tag/Tag.styles.tsx
196
196
  var tagStyles = (0, import_class_variance_authority.cva)(
197
197
  [
198
- "box-border inline-flex items-center justify-center gap-sm whitespace-nowrap",
198
+ "box-border default:inline-flex default:w-fit items-center justify-center gap-sm whitespace-nowrap",
199
199
  "text-caption font-bold",
200
200
  "px-md"
201
201
  ],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tag/index.ts","../../src/slot/Slot.tsx","../../src/tag/Tag.styles.tsx","../../src/tag/variants/filled.ts","../../src/tag/variants/outlined.ts","../../src/tag/variants/tinted.ts","../../src/tag/Tag.tsx"],"sourcesContent":["export * from './Tag'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, outlinedVariants, tintedVariants } from './variants'\n\nexport const tagStyles = cva(\n [\n 'box-border inline-flex items-center justify-center gap-sm whitespace-nowrap',\n 'text-caption font-bold',\n 'px-md',\n ],\n {\n variants: {\n /**\n * Main style of the tag.\n * - `filled`: Tag will be plain.\n * - `outlined`: Tag will have a surface background with an colored outline/text.\n * - `tinted`: Tag will be filled but using a lighter color scheme.\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted']>({\n filled: [],\n outlined: ['border-sm', 'border-current'],\n tinted: [],\n }),\n size: makeVariants<'size', ['md', 'lg']>({\n md: ['h-sz-20'],\n lg: ['h-sz-24'],\n }),\n shape: makeVariants<'shape', ['square', 'rounded', 'pill']>({\n square: [],\n rounded: ['rounded-md'],\n pill: ['rounded-full'],\n }),\n /**\n * Color scheme of the tag.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'info',\n 'neutral',\n 'danger',\n 'surface',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n }),\n },\n compoundVariants: [...filledVariants, ...outlinedVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'basic',\n size: 'md',\n shape: 'pill',\n },\n }\n)\n\nexport type TagStylesProps = VariantProps<typeof tagStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n {\n intent: 'main',\n design: 'filled',\n class: tw(['bg-main', 'text-on-main']),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw(['bg-support', 'text-on-support']),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw(['bg-accent', 'text-on-accent']),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw(['bg-basic', 'text-on-basic']),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw(['bg-success', 'text-on-success']),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw(['bg-alert', 'text-on-alert']),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw(['bg-error', 'text-on-error']),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw(['bg-info', 'text-on-info']),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw(['bg-neutral', 'text-on-neutral']),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw(['bg-surface', 'text-on-surface']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw(['text-main']),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw(['text-support']),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw(['text-accent']),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw(['text-basic']),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw(['text-success']),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw(['text-alert']),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw(['text-error']),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw(['text-info']),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw(['text-neutral']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw(['bg-main-container', 'text-on-main-container']),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw(['bg-support-container', 'text-on-support-container']),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw(['bg-accent-container', 'text-on-accent-container']),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw(['bg-basic-container', 'text-on-basic-container']),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw(['bg-success-container', 'text-on-success-container']),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw(['bg-alert-container', 'text-on-alert-container']),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw(['bg-error-container', 'text-on-error-container']),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw(['bg-info-container', 'text-on-info-container']),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw(['bg-neutral-container', 'text-on-neutral-container']),\n },\n] as const\n","import { ButtonHTMLAttributes, type PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { tagStyles, type TagStylesProps } from './Tag.styles'\n\ninterface BaseTagProps\n extends PropsWithChildren<ButtonHTMLAttributes<HTMLSpanElement>>,\n TagStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n}\n\ninterface FilteredDesignIntent<\n Design extends TagProps['design'],\n K extends TagStylesProps['intent'] | never = never,\n> {\n design?: Design\n intent?: Exclude<TagStylesProps['intent'], K>\n ref?: Ref<HTMLButtonElement>\n}\n\nexport type ValidTagDesignIntent =\n | FilteredDesignIntent<'tinted', 'surface'>\n | FilteredDesignIntent<'outlined', 'surface'>\n | FilteredDesignIntent<'filled'>\n\nexport type TagProps = BaseTagProps & ValidTagDesignIntent\n\nexport const Tag = ({\n design = 'filled',\n intent = 'basic',\n size = 'md',\n shape = 'pill',\n asChild,\n className,\n ref,\n ...others\n}: TagProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n data-spark-component=\"tag\"\n ref={ref}\n className={tagStyles({\n className,\n design,\n intent,\n size,\n shape,\n })}\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al_utils","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/tag/index.ts","../../src/slot/Slot.tsx","../../src/tag/Tag.styles.tsx","../../src/tag/variants/filled.ts","../../src/tag/variants/outlined.ts","../../src/tag/variants/tinted.ts","../../src/tag/Tag.tsx"],"sourcesContent":["export * from './Tag'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, outlinedVariants, tintedVariants } from './variants'\n\nexport const tagStyles = cva(\n [\n 'box-border default:inline-flex default:w-fit items-center justify-center gap-sm whitespace-nowrap',\n 'text-caption font-bold',\n 'px-md',\n ],\n {\n variants: {\n /**\n * Main style of the tag.\n * - `filled`: Tag will be plain.\n * - `outlined`: Tag will have a surface background with an colored outline/text.\n * - `tinted`: Tag will be filled but using a lighter color scheme.\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted']>({\n filled: [],\n outlined: ['border-sm', 'border-current'],\n tinted: [],\n }),\n size: makeVariants<'size', ['md', 'lg']>({\n md: ['h-sz-20'],\n lg: ['h-sz-24'],\n }),\n shape: makeVariants<'shape', ['square', 'rounded', 'pill']>({\n square: [],\n rounded: ['rounded-md'],\n pill: ['rounded-full'],\n }),\n /**\n * Color scheme of the tag.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'info',\n 'neutral',\n 'danger',\n 'surface',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n }),\n },\n compoundVariants: [...filledVariants, ...outlinedVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'basic',\n size: 'md',\n shape: 'pill',\n },\n }\n)\n\nexport type TagStylesProps = VariantProps<typeof tagStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n {\n intent: 'main',\n design: 'filled',\n class: tw(['bg-main', 'text-on-main']),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw(['bg-support', 'text-on-support']),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw(['bg-accent', 'text-on-accent']),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw(['bg-basic', 'text-on-basic']),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw(['bg-success', 'text-on-success']),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw(['bg-alert', 'text-on-alert']),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw(['bg-error', 'text-on-error']),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw(['bg-info', 'text-on-info']),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw(['bg-neutral', 'text-on-neutral']),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw(['bg-surface', 'text-on-surface']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw(['text-main']),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw(['text-support']),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw(['text-accent']),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw(['text-basic']),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw(['text-success']),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw(['text-alert']),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw(['text-error']),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw(['text-info']),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw(['text-neutral']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw(['bg-main-container', 'text-on-main-container']),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw(['bg-support-container', 'text-on-support-container']),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw(['bg-accent-container', 'text-on-accent-container']),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw(['bg-basic-container', 'text-on-basic-container']),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw(['bg-success-container', 'text-on-success-container']),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw(['bg-alert-container', 'text-on-alert-container']),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw(['bg-error-container', 'text-on-error-container']),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw(['bg-info-container', 'text-on-info-container']),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw(['bg-neutral-container', 'text-on-neutral-container']),\n },\n] as const\n","import { ButtonHTMLAttributes, type PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { tagStyles, type TagStylesProps } from './Tag.styles'\n\ninterface BaseTagProps\n extends PropsWithChildren<ButtonHTMLAttributes<HTMLSpanElement>>,\n TagStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n}\n\ninterface FilteredDesignIntent<\n Design extends TagProps['design'],\n K extends TagStylesProps['intent'] | never = never,\n> {\n design?: Design\n intent?: Exclude<TagStylesProps['intent'], K>\n ref?: Ref<HTMLButtonElement>\n}\n\nexport type ValidTagDesignIntent =\n | FilteredDesignIntent<'tinted', 'surface'>\n | FilteredDesignIntent<'outlined', 'surface'>\n | FilteredDesignIntent<'filled'>\n\nexport type TagProps = BaseTagProps & ValidTagDesignIntent\n\nexport const Tag = ({\n design = 'filled',\n intent = 'basic',\n size = 'md',\n shape = 'pill',\n asChild,\n className,\n ref,\n ...others\n}: TagProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n data-spark-component=\"tag\"\n ref={ref}\n className={tagStyles({\n className,\n design,\n intent,\n size,\n shape,\n })}\n {...others}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAA,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;;;AClBA,IAAAC,yBAA6B;AAC7B,sCAAkC;;;ACDlC,4BAAmB;AAEZ,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAO,0BAAG,CAAC,WAAW,cAAc,CAAC;AAAA,EACvC;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAO,0BAAG,CAAC,cAAc,iBAAiB,CAAC;AAAA,EAC7C;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAO,0BAAG,CAAC,aAAa,gBAAgB,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAO,0BAAG,CAAC,YAAY,e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T;AAAA,EACF;AACF;;;AI5BI,IAAAC,sBAAA;AAbG,IAAM,MAAM,CAAC;AAAA,EAClB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAgB;AACd,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAW,UAAU;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["RadixSlot","import_internal_utils","import_internal_utils","import_internal_utils","import_jsx_runtime"]}
@@ -164,7 +164,7 @@ var tintedVariants = [
164
164
  // src/tag/Tag.styles.tsx
165
165
  var tagStyles = cva(
166
166
  [
167
- "box-border inline-flex items-center justify-center gap-sm whitespace-nowrap",
167
+ "box-border default:inline-flex default:w-fit items-center justify-center gap-sm whitespace-nowrap",
168
168
  "text-caption font-bold",
169
169
  "px-md"
170
170
  ],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tag/Tag.styles.tsx","../../src/tag/variants/filled.ts","../../src/tag/variants/outlined.ts","../../src/tag/variants/tinted.ts","../../src/tag/Tag.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, outlinedVariants, tintedVariants } from './variants'\n\nexport const tagStyles = cva(\n [\n 'box-border inline-flex items-center justify-center gap-sm whitespace-nowrap',\n 'text-caption font-bold',\n 'px-md',\n ],\n {\n variants: {\n /**\n * Main style of the tag.\n * - `filled`: Tag will be plain.\n * - `outlined`: Tag will have a surface background with an colored outline/text.\n * - `tinted`: Tag will be filled but using a lighter color scheme.\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted']>({\n filled: [],\n outlined: ['border-sm', 'border-current'],\n tinted: [],\n }),\n size: makeVariants<'size', ['md', 'lg']>({\n md: ['h-sz-20'],\n lg: ['h-sz-24'],\n }),\n shape: makeVariants<'shape', ['square', 'rounded', 'pill']>({\n square: [],\n rounded: ['rounded-md'],\n pill: ['rounded-full'],\n }),\n /**\n * Color scheme of the tag.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'info',\n 'neutral',\n 'danger',\n 'surface',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n }),\n },\n compoundVariants: [...filledVariants, ...outlinedVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'basic',\n size: 'md',\n shape: 'pill',\n },\n }\n)\n\nexport type TagStylesProps = VariantProps<typeof tagStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n {\n intent: 'main',\n design: 'filled',\n class: tw(['bg-main', 'text-on-main']),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw(['bg-support', 'text-on-support']),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw(['bg-accent', 'text-on-accent']),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw(['bg-basic', 'text-on-basic']),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw(['bg-success', 'text-on-success']),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw(['bg-alert', 'text-on-alert']),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw(['bg-error', 'text-on-error']),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw(['bg-info', 'text-on-info']),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw(['bg-neutral', 'text-on-neutral']),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw(['bg-surface', 'text-on-surface']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw(['text-main']),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw(['text-support']),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw(['text-accent']),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw(['text-basic']),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw(['text-success']),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw(['text-alert']),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw(['text-error']),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw(['text-info']),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw(['text-neutral']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw(['bg-main-container', 'text-on-main-container']),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw(['bg-support-container', 'text-on-support-container']),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw(['bg-accent-container', 'text-on-accent-container']),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw(['bg-basic-container', 'text-on-basic-container']),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw(['bg-success-container', 'text-on-success-container']),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw(['bg-alert-container', 'text-on-alert-container']),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw(['bg-error-container', 'text-on-error-container']),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw(['bg-info-container', 'text-on-info-container']),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw(['bg-neutral-container', 'text-on-neutral-container']),\n },\n] as const\n","import { ButtonHTMLAttributes, type PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { tagStyles, type TagStylesProps } from './Tag.styles'\n\ninterface BaseTagProps\n extends PropsWithChildren<ButtonHTMLAttributes<HTMLSpanElement>>,\n TagStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n}\n\ninterface FilteredDesignIntent<\n Design extends TagProps['design'],\n K extends TagStylesProps['intent'] | never = never,\n> {\n design?: Design\n intent?: Exclude<TagStylesProps['intent'], K>\n ref?: Ref<HTMLButtonElement>\n}\n\nexport type ValidTagDesignIntent =\n | FilteredDesignIntent<'tinted', 'surface'>\n | FilteredDesignIntent<'outlined', 'surface'>\n | FilteredDesignIntent<'filled'>\n\nexport type TagProps = BaseTagProps & ValidTagDesignIntent\n\nexport const Tag = ({\n design = 'filled',\n intent = 'basic',\n size = 'md',\n shape = 'pill',\n asChild,\n className,\n ref,\n ...others\n}: TagProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n data-spark-component=\"tag\"\n ref={ref}\n className={tagStyles({\n className,\n design,\n intent,\n size,\n shape,\n })}\n {...others}\n />\n )\n}\n"],"mappings":";;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAAyB;;;ACDlC,SAAS,UAAU;AAEZ,IAAM,iBAAiB;AAAA,EAC5B;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,GAAG,CAAC,WAAW,cAAc,CAAC;AAAA,EACvC;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,GAAG,CAAC,cAAc,iBAAiB,CAAC;AAAA,EAC7C;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,GAAG,CAAC,aAAa,gBAAgB,CAAC;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,GAAG,CAAC,YAAY,eAAe,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,GAAG,CAAC,cAAc,iBAAiB,CAAC;AAAA,EAC7C;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IAC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YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAW,UAAU;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["tw","tw"]}
1
+ {"version":3,"sources":["../../src/tag/Tag.styles.tsx","../../src/tag/variants/filled.ts","../../src/tag/variants/outlined.ts","../../src/tag/variants/tinted.ts","../../src/tag/Tag.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, outlinedVariants, tintedVariants } from './variants'\n\nexport const tagStyles = cva(\n [\n 'box-border default:inline-flex default:w-fit items-center justify-center gap-sm whitespace-nowrap',\n 'text-caption font-bold',\n 'px-md',\n ],\n {\n variants: {\n /**\n * Main style of the tag.\n * - `filled`: Tag will be plain.\n * - `outlined`: Tag will have a surface background with an colored outline/text.\n * - `tinted`: Tag will be filled but using a lighter color scheme.\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted']>({\n filled: [],\n outlined: ['border-sm', 'border-current'],\n tinted: [],\n }),\n size: makeVariants<'size', ['md', 'lg']>({\n md: ['h-sz-20'],\n lg: ['h-sz-24'],\n }),\n shape: makeVariants<'shape', ['square', 'rounded', 'pill']>({\n square: [],\n rounded: ['rounded-md'],\n pill: ['rounded-full'],\n }),\n /**\n * Color scheme of the tag.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'info',\n 'neutral',\n 'danger',\n 'surface',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n }),\n },\n compoundVariants: [...filledVariants, ...outlinedVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'basic',\n size: 'md',\n shape: 'pill',\n },\n }\n)\n\nexport type TagStylesProps = VariantProps<typeof tagStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n {\n intent: 'main',\n design: 'filled',\n class: tw(['bg-main', 'text-on-main']),\n },\n {\n intent: 'support',\n design: 'filled',\n class: tw(['bg-support', 'text-on-support']),\n },\n {\n intent: 'accent',\n design: 'filled',\n class: tw(['bg-accent', 'text-on-accent']),\n },\n {\n intent: 'basic',\n design: 'filled',\n class: tw(['bg-basic', 'text-on-basic']),\n },\n {\n intent: 'success',\n design: 'filled',\n class: tw(['bg-success', 'text-on-success']),\n },\n {\n intent: 'alert',\n design: 'filled',\n class: tw(['bg-alert', 'text-on-alert']),\n },\n {\n intent: 'danger',\n design: 'filled',\n class: tw(['bg-error', 'text-on-error']),\n },\n {\n intent: 'info',\n design: 'filled',\n class: tw(['bg-info', 'text-on-info']),\n },\n {\n intent: 'neutral',\n design: 'filled',\n class: tw(['bg-neutral', 'text-on-neutral']),\n },\n {\n intent: 'surface',\n design: 'filled',\n class: tw(['bg-surface', 'text-on-surface']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw(['text-main']),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw(['text-support']),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw(['text-accent']),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw(['text-basic']),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw(['text-success']),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw(['text-alert']),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw(['text-error']),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw(['text-info']),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw(['text-neutral']),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw(['bg-main-container', 'text-on-main-container']),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw(['bg-support-container', 'text-on-support-container']),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw(['bg-accent-container', 'text-on-accent-container']),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw(['bg-basic-container', 'text-on-basic-container']),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw(['bg-success-container', 'text-on-success-container']),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw(['bg-alert-container', 'text-on-alert-container']),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw(['bg-error-container', 'text-on-error-container']),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw(['bg-info-container', 'text-on-info-container']),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw(['bg-neutral-container', 'text-on-neutral-container']),\n },\n] as const\n","import { ButtonHTMLAttributes, type PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { tagStyles, type TagStylesProps } from './Tag.styles'\n\ninterface BaseTagProps\n extends PropsWithChildren<ButtonHTMLAttributes<HTMLSpanElement>>,\n TagStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n}\n\ninterface FilteredDesignIntent<\n Design extends TagProps['design'],\n K extends TagStylesProps['intent'] | never = never,\n> {\n design?: Design\n intent?: Exclude<TagStylesProps['intent'], K>\n ref?: Ref<HTMLButtonElement>\n}\n\nexport type ValidTagDesignIntent =\n | FilteredDesignIntent<'tinted', 'surface'>\n | FilteredDesignIntent<'outlined', 'surface'>\n | FilteredDesignIntent<'filled'>\n\nexport type TagProps = BaseTagProps & ValidTagDesignIntent\n\nexport const Tag = ({\n design = 'filled',\n intent = 'basic',\n size = 'md',\n shape = 'pill',\n asChild,\n className,\n ref,\n ...others\n}: TagProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n data-spark-component=\"tag\"\n ref={ref}\n className={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1D,QAAQ,CAAC;AAAA,QACT,SAAS,CAAC,YAAY;AAAA,QACtB,MAAM,CAAC,cAAc;AAAA,MACvB,CAAC;AAAA;AAAA;AAAA;AAAA,MAID,QAAQ,aAcN;AAAA,QACA,MAAM,CAAC;AAAA,QACP,SAAS,CAAC;AAAA,QACV,QAAQ,CAAC;AAAA,QACT,OAAO,CAAC;AAAA,QACR,SAAS,CAAC;AAAA,QACV,OAAO,CAAC;AAAA,QACR,QAAQ,CAAC;AAAA,QACT,MAAM,CAAC;AAAA,QACP,SAAS,CAAC;AAAA,QACV,SAAS,CAAC;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,IACA,kBAAkB,CAAC,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,cAAc;AAAA,IAC5E,iBAAiB;AAAA,MACf,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AACF;;;AI5BI;AAbG,IAAM,MAAM,CAAC;AAAA,EAClB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAgB;AACd,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAW,UAAU;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["tw","tw"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/components",
3
- "version": "10.17.2",
3
+ "version": "10.17.4",
4
4
  "license": "MIT",
5
5
  "description": "Spark (Leboncoin design system) components.",
6
6
  "exports": {
@@ -47,15 +47,15 @@
47
47
  "build": "NODE_OPTIONS='--max-old-space-size=8192' tsup"
48
48
  },
49
49
  "dependencies": {
50
- "@base-ui-components/react": "^1.0.0-beta.1",
50
+ "@base-ui-components/react": "^1.0.0-beta.3",
51
51
  "@react-aria/button": "3.13.0",
52
52
  "@react-aria/numberfield": "3.11.13",
53
53
  "@react-aria/toast": "^3.0.0-beta.18",
54
54
  "@react-stately/numberfield": "3.9.11",
55
55
  "@react-stately/toast": "^3.0.0-beta.7",
56
- "@spark-ui/hooks": "^10.17.2",
57
- "@spark-ui/icons": "^10.17.2",
58
- "@spark-ui/internal-utils": "^10.17.2",
56
+ "@spark-ui/hooks": "^10.17.4",
57
+ "@spark-ui/icons": "^10.17.4",
58
+ "@spark-ui/internal-utils": "^10.17.4",
59
59
  "@zag-js/pagination": "1.14.0",
60
60
  "@zag-js/react": "1.14.0",
61
61
  "class-variance-authority": "0.7.1",
@@ -82,5 +82,5 @@
82
82
  "url": "https://github.com/leboncoin/spark-web/issues?q=is%3Aopen+label%3A%22Component%3A+button%22"
83
83
  },
84
84
  "homepage": "https://sparkui.vercel.app",
85
- "gitHead": "947c5ead9e011edef6b1ab3066b7422ed774d884"
85
+ "gitHead": "8634f2de9ad8883173b52d9ae48a48b23bbfd605"
86
86
  }