@spark-ui/components 16.1.1-beta.0 → 16.2.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.
- package/dist/{Button-BIAkZTRR.js → Button-B6rA3-e5.js} +2 -2
- package/dist/{Button-BIAkZTRR.js.map → Button-B6rA3-e5.js.map} +1 -1
- package/dist/{Button-DggC4GFM.mjs → Button-DPncfbbM.mjs} +2 -2
- package/dist/{Button-DggC4GFM.mjs.map → Button-DPncfbbM.mjs.map} +1 -1
- package/dist/{IconButton-Mv9tO1ZH.mjs → IconButton-Bfd-6BAD.mjs} +14 -14
- package/dist/IconButton-Bfd-6BAD.mjs.map +1 -0
- package/dist/IconButton-D3g86WpZ.js +2 -0
- package/dist/IconButton-D3g86WpZ.js.map +1 -0
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/carousel/index.js +1 -1
- package/dist/carousel/index.mjs +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +30 -30
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chip/index.js +1 -1
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +1 -1
- package/dist/chip/index.mjs.map +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +39 -39
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/index.mjs +1 -1
- package/dist/dropdown/index.js +1 -1
- package/dist/dropdown/index.js.map +1 -1
- package/dist/dropdown/index.mjs +1 -1
- package/dist/dropdown/index.mjs.map +1 -1
- package/dist/file-upload/index.js +1 -1
- package/dist/file-upload/index.mjs +2 -2
- package/dist/icon-button/index.js +1 -1
- package/dist/icon-button/index.mjs +1 -1
- package/dist/input/index.js +1 -1
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +6 -6
- package/dist/input/index.mjs.map +1 -1
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/index.mjs +2 -2
- package/dist/popover/index.js +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/radio-group/index.js +1 -1
- package/dist/radio-group/index.js.map +1 -1
- package/dist/radio-group/index.mjs +7 -7
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/scrolling-list/index.js +1 -1
- package/dist/scrolling-list/index.mjs +2 -2
- package/dist/select/index.js +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/select/index.mjs.map +1 -1
- package/dist/snackbar/index.js +1 -1
- package/dist/snackbar/index.mjs +2 -2
- package/dist/stepper/index.js +1 -1
- package/dist/stepper/index.mjs +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/index.mjs +2 -2
- package/dist/tag/index.js +1 -1
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/index.mjs +6 -6
- package/dist/tag/index.mjs.map +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +14 -10
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast/index.mjs +2 -2
- package/package.json +4 -4
- package/dist/IconButton-D5fk89W-.js +0 -2
- package/dist/IconButton-D5fk89W-.js.map +0 -1
- package/dist/IconButton-Mv9tO1ZH.mjs.map +0 -1
package/dist/textarea/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { InputGroup as e, Input as i } from "../input/index.mjs";
|
|
3
|
-
import { cx as
|
|
3
|
+
import { cx as T } from "class-variance-authority";
|
|
4
4
|
const t = (a) => /* @__PURE__ */ r(e.ClearButton, { inline: !0, "data-spark-component": "textarea-group-trailing-icon", ...a });
|
|
5
5
|
t.id = e.ClearButton.id;
|
|
6
6
|
t.displayName = "TextareaGroup.ClearButton";
|
|
@@ -12,28 +12,32 @@ n.displayName = "TextareaGroup.LeadingIcon";
|
|
|
12
12
|
const o = (a) => /* @__PURE__ */ r(e.TrailingIcon, { "data-spark-component": "textarea-group-trailing-icon", ...a });
|
|
13
13
|
o.id = e.TrailingIcon.id;
|
|
14
14
|
o.displayName = "TextareaGroup.TrailingIcon";
|
|
15
|
-
const
|
|
15
|
+
const c = ({
|
|
16
16
|
className: a,
|
|
17
|
-
disabled:
|
|
18
|
-
rows:
|
|
17
|
+
disabled: s,
|
|
18
|
+
rows: d = 1,
|
|
19
19
|
isResizable: u = !0,
|
|
20
20
|
ref: l,
|
|
21
21
|
onValueChange: x,
|
|
22
|
-
...
|
|
22
|
+
...g
|
|
23
23
|
}) => /* @__PURE__ */ r(
|
|
24
24
|
i,
|
|
25
25
|
{
|
|
26
|
-
className:
|
|
26
|
+
className: T(
|
|
27
|
+
a,
|
|
28
|
+
"py-[var(--spacing-sz-10)]",
|
|
29
|
+
u ? "resize-y" : "resize-none"
|
|
30
|
+
),
|
|
27
31
|
"data-spark-component": "textarea",
|
|
28
|
-
disabled:
|
|
32
|
+
disabled: s,
|
|
29
33
|
asChild: !0,
|
|
30
34
|
onValueChange: x,
|
|
31
|
-
children: /* @__PURE__ */ r("textarea", { ref: l, rows:
|
|
35
|
+
children: /* @__PURE__ */ r("textarea", { ref: l, rows: d, ...g })
|
|
32
36
|
}
|
|
33
|
-
), N = Object.assign(
|
|
37
|
+
), N = Object.assign(c, {
|
|
34
38
|
id: i.id
|
|
35
39
|
});
|
|
36
|
-
|
|
40
|
+
c.displayName = "Textarea";
|
|
37
41
|
const m = Object.assign(p, {
|
|
38
42
|
LeadingIcon: n,
|
|
39
43
|
TrailingIcon: o,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/textarea/TextareaClearButton.tsx","../../src/textarea/TextareaGroup.tsx","../../src/textarea/TextareaLeadingIcon.tsx","../../src/textarea/TextareaTrailingIcon.tsx","../../src/textarea/Textarea.tsx","../../src/textarea/index.ts"],"sourcesContent":["import { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { InputGroup } from '../input'\n\nexport interface TextareaClearButtonProps extends ComponentPropsWithoutRef<'button'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TextareaClearButton = (props: TextareaClearButtonProps) => {\n return (\n <InputGroup.ClearButton inline data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n )\n}\n\nTextareaClearButton.id = InputGroup.ClearButton.id\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n","import { InputGroup, InputGroupProps } from '../input'\n\nexport type TextareaGroupProps = InputGroupProps\n\nexport const TextareaGroup = (props: TextareaGroupProps) => {\n return <InputGroup {...props} />\n}\n\nTextareaGroup.displayName = 'TextareaGroup'\n","import { InputGroup, InputLeadingIconProps } from '../input'\n\nexport type TextareaLeadingIconProps = InputLeadingIconProps\n\nexport const TextareaLeadingIcon = (props: InputLeadingIconProps) => {\n return <InputGroup.LeadingIcon data-spark-component=\"textarea-group-leading-icon\" {...props} />\n}\n\nTextareaLeadingIcon.id = InputGroup.LeadingIcon.id\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\n","import { InputGroup, InputTrailingIconProps } from '../input'\n\nexport type TextareaTrailingIconProps = InputTrailingIconProps\n\nexport const TextareaTrailingIcon = (props: InputTrailingIconProps) => {\n return <InputGroup.TrailingIcon data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n}\n\nTextareaTrailingIcon.id = InputGroup.TrailingIcon.id\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, PropsWithChildren, Ref } from 'react'\n\nimport { Input, InputProps } from '../input'\n\ntype TextareaPrimitiveProps = ComponentPropsWithoutRef<'textarea'>\n\nexport interface TextareaProps extends TextareaPrimitiveProps, Pick<InputProps, 'onValueChange'> {\n isResizable?: boolean\n ref?: Ref<HTMLTextAreaElement>\n}\n\nconst Root = ({\n className,\n disabled,\n rows = 1,\n isResizable = true,\n ref,\n onValueChange,\n ...others\n}: PropsWithChildren<TextareaProps>) => {\n return (\n <Input\n className={cx(className
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/textarea/TextareaClearButton.tsx","../../src/textarea/TextareaGroup.tsx","../../src/textarea/TextareaLeadingIcon.tsx","../../src/textarea/TextareaTrailingIcon.tsx","../../src/textarea/Textarea.tsx","../../src/textarea/index.ts"],"sourcesContent":["import { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { InputGroup } from '../input'\n\nexport interface TextareaClearButtonProps extends ComponentPropsWithoutRef<'button'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const TextareaClearButton = (props: TextareaClearButtonProps) => {\n return (\n <InputGroup.ClearButton inline data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n )\n}\n\nTextareaClearButton.id = InputGroup.ClearButton.id\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n","import { InputGroup, InputGroupProps } from '../input'\n\nexport type TextareaGroupProps = InputGroupProps\n\nexport const TextareaGroup = (props: TextareaGroupProps) => {\n return <InputGroup {...props} />\n}\n\nTextareaGroup.displayName = 'TextareaGroup'\n","import { InputGroup, InputLeadingIconProps } from '../input'\n\nexport type TextareaLeadingIconProps = InputLeadingIconProps\n\nexport const TextareaLeadingIcon = (props: InputLeadingIconProps) => {\n return <InputGroup.LeadingIcon data-spark-component=\"textarea-group-leading-icon\" {...props} />\n}\n\nTextareaLeadingIcon.id = InputGroup.LeadingIcon.id\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\n","import { InputGroup, InputTrailingIconProps } from '../input'\n\nexport type TextareaTrailingIconProps = InputTrailingIconProps\n\nexport const TextareaTrailingIcon = (props: InputTrailingIconProps) => {\n return <InputGroup.TrailingIcon data-spark-component=\"textarea-group-trailing-icon\" {...props} />\n}\n\nTextareaTrailingIcon.id = InputGroup.TrailingIcon.id\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, PropsWithChildren, Ref } from 'react'\n\nimport { Input, InputProps } from '../input'\n\ntype TextareaPrimitiveProps = ComponentPropsWithoutRef<'textarea'>\n\nexport interface TextareaProps extends TextareaPrimitiveProps, Pick<InputProps, 'onValueChange'> {\n isResizable?: boolean\n ref?: Ref<HTMLTextAreaElement>\n}\n\nconst Root = ({\n className,\n disabled,\n rows = 1,\n isResizable = true,\n ref,\n onValueChange,\n ...others\n}: PropsWithChildren<TextareaProps>) => {\n return (\n <Input\n className={cx(\n className,\n 'py-[var(--spacing-sz-10)]',\n isResizable ? 'resize-y' : 'resize-none'\n )}\n data-spark-component=\"textarea\"\n disabled={disabled}\n asChild\n onValueChange={onValueChange}\n >\n <textarea ref={ref} rows={rows} {...others} />\n </Input>\n )\n}\n\nexport const Textarea = Object.assign(Root, {\n id: Input.id,\n})\n\nRoot.displayName = 'Textarea'\n","import { TextareaClearButton } from './TextareaClearButton'\nimport { TextareaGroup as Root } from './TextareaGroup'\nimport { TextareaLeadingIcon } from './TextareaLeadingIcon'\nimport { TextareaTrailingIcon } from './TextareaTrailingIcon'\n\nexport * from './Textarea'\n\nexport const TextareaGroup: typeof Root & {\n LeadingIcon: typeof TextareaLeadingIcon\n TrailingIcon: typeof TextareaTrailingIcon\n ClearButton: typeof TextareaClearButton\n} = Object.assign(Root, {\n LeadingIcon: TextareaLeadingIcon,\n TrailingIcon: TextareaTrailingIcon,\n ClearButton: TextareaClearButton,\n})\n\nTextareaGroup.displayName = 'TextareaGroup'\nTextareaLeadingIcon.displayName = 'TextareaGroup.LeadingIcon'\nTextareaTrailingIcon.displayName = 'TextareaGroup.TrailingIcon'\nTextareaClearButton.displayName = 'TextareaGroup.ClearButton'\n\nexport { type TextareaGroupProps } from './TextareaGroup'\nexport { type TextareaLeadingIconProps } from './TextareaLeadingIcon'\nexport { type TextareaTrailingIconProps } from './TextareaTrailingIcon'\nexport { type TextareaClearButtonProps } from './TextareaClearButton'\n"],"names":["TextareaClearButton","props","jsx","InputGroup","TextareaGroup","TextareaLeadingIcon","TextareaTrailingIcon","Root","className","disabled","rows","isResizable","ref","onValueChange","others","Input","cx","Textarea"],"mappings":";;;AASO,MAAMA,IAAsB,CAACC,MAEhC,gBAAAC,EAACC,EAAW,aAAX,EAAuB,QAAM,IAAC,wBAAqB,gCAAgC,GAAGF,GAAO;AAIlGD,EAAoB,KAAKG,EAAW,YAAY;AAChDH,EAAoB,cAAc;ACZ3B,MAAMI,IAAgB,CAACH,MACrB,gBAAAC,EAACC,GAAA,EAAY,GAAGF,EAAA,CAAO;AAGhCG,EAAc,cAAc;ACJrB,MAAMC,IAAsB,CAACJ,wBAC1BE,EAAW,aAAX,EAAuB,wBAAqB,+BAA+B,GAAGF,GAAO;AAG/FI,EAAoB,KAAKF,EAAW,YAAY;AAChDE,EAAoB,cAAc;ACL3B,MAAMC,IAAuB,CAACL,wBAC3BE,EAAW,cAAX,EAAwB,wBAAqB,gCAAgC,GAAGF,GAAO;AAGjGK,EAAqB,KAAKH,EAAW,aAAa;AAClDG,EAAqB,cAAc;ACGnC,MAAMC,IAAO,CAAC;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAAA,EACd,KAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAZ;AAAA,EAACa;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACTR;AAAA,MACA;AAAA,MACAG,IAAc,aAAa;AAAA,IAAA;AAAA,IAE7B,wBAAqB;AAAA,IACrB,UAAAF;AAAA,IACA,SAAO;AAAA,IACP,eAAAI;AAAA,IAEA,UAAA,gBAAAX,EAAC,YAAA,EAAS,KAAAU,GAAU,MAAAF,GAAa,GAAGI,EAAA,CAAQ;AAAA,EAAA;AAAA,GAKrCG,IAAW,OAAO,OAAOV,GAAM;AAAA,EAC1C,IAAIQ,EAAM;AACZ,CAAC;AAEDR,EAAK,cAAc;ACnCZ,MAAMH,IAIT,OAAO,OAAOG,GAAM;AAAA,EACtB,aAAaF;AAAA,EACb,cAAcC;AAAA,EACd,aAAaN;AACf,CAAC;AAEDI,EAAc,cAAc;AAC5BC,EAAoB,cAAc;AAClCC,EAAqB,cAAc;AACnCN,EAAoB,cAAc;"}
|
package/dist/toast/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("@base-ui/react/toast"),_=require("../Slot-DQ8z2zsy.js"),c=require("class-variance-authority"),I=require("../Button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("@base-ui/react/toast"),_=require("../Slot-DQ8z2zsy.js"),c=require("class-variance-authority"),I=require("../Button-B6rA3-e5.js"),w=require("../Icon-CF0W0LKr.js"),N=require("../IconButton-D3g86WpZ.js"),q=require("@spark-ui/icons/AlertFill"),C=require("@spark-ui/icons/Close"),h=require("@spark-ui/icons/InfoFill"),P=require("@spark-ui/icons/ValidFill"),M=require("@spark-ui/icons/WarningFill"),D=require("react");function F(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return s.default=e,Object.freeze(s)}const B=F(D),O=c.cva(["gap-lg p-md flex w-max !w-[min(400px,calc(100vw-2rem))] flex-col rounded-lg border-md","absolute right-0 bottom-0 left-auto mr-0","bg-clip-padding shadow-md select-none","focus-visible:ring-focus focus-visible:ring-2 focus-visible:outline-none","z-[calc(1000-var(--toast-index))]","after:absolute after:bottom-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*-16px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))]","ease-standard [transition-property:opacity,transform]","duration-400","data-[starting-style]:[transform:translateY(150%)]","data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y)))]","data-[ending-style]:duration-250","data-[ending-style]:opacity-0","data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-[expanded]:data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-[limited]:opacity-0"],{variants:{design:{filled:"",tinted:""},intent:{success:"",alert:"",error:"",info:"",neutral:"",main:"",basic:"",support:"",accent:"",surface:"",surfaceInverse:""}},compoundVariants:[{design:"filled",intent:"success",class:["bg-success text-on-success border-success"]},{design:"filled",intent:"alert",class:["bg-alert text-on-alert border-alert"]},{design:"filled",intent:"error",class:["bg-error text-on-error border-error"]},{design:"filled",intent:"info",class:["bg-info text-on-info border-info"]},{design:"filled",intent:"neutral",class:["bg-neutral text-on-neutral border-neutral"]},{design:"filled",intent:"main",class:["bg-main text-on-main border-main"]},{design:"filled",intent:"basic",class:["bg-basic text-on-basic border-basic"]},{design:"filled",intent:"support",class:["bg-support text-on-support border-support"]},{design:"filled",intent:"accent",class:["bg-accent text-on-accent border-accent"]},{design:"filled",intent:"surface",class:["bg-surface text-on-surface border-surface"]},{design:"filled",intent:"surfaceInverse",class:["bg-surface-inverse text-on-surface-inverse border-surface-inverse"]},{design:"tinted",intent:"success",class:["bg-success-container text-on-success-container border-success"]},{design:"tinted",intent:"alert",class:["bg-alert-container text-on-alert-container border-alert"]},{design:"tinted",intent:"error",class:["bg-error-container text-on-error-container border-error"]},{design:"tinted",intent:"info",class:["bg-info-container text-on-info-container border-info"]},{design:"tinted",intent:"neutral",class:["bg-neutral-container text-on-neutral-container border-neutral"]},{design:"tinted",intent:"main",class:["bg-main-container text-on-main-container border-main"]},{design:"tinted",intent:"basic",class:["bg-basic-container text-on-basic-container border-basic"]},{design:"tinted",intent:"support",class:["bg-support-container text-on-support-container border-support"]},{design:"tinted",intent:"accent",class:["bg-accent-container text-on-accent-container border-accent"]},{design:"tinted",intent:"surface",class:["bg-surface text-on-surface border-surface"]},{design:"tinted",intent:"surfaceInverse",class:["bg-surface-inverse text-on-surface-inverse border-surface-inverse"]}],defaultVariants:{design:"filled",intent:"neutral"}});c.cva(["inline-grid items-center","col-start-1 row-start-1","pl-md pr-lg"],{variants:{actionOnNewline:{true:["grid-rows-[52px_1fr_52px]","grid-cols-[min-content_1fr_min-content]","[grid-template-areas:'icon_message_close'_'._message_.'_'action_action_action']"],false:["grid-cols-[min-content_1fr_min-content_min-content]","[grid-template-areas:'icon_message_action_close']"]}},defaultVariants:{actionOnNewline:!1}});function A(e){return e==="surfaceInverse"?"surface":e==="surface"?"surfaceInverse":e==="error"?"danger":e}function S(e){return e==="surfaceInverse"?"surfaceInverse":e==="surface"?"surface":e==="error"?"danger":e}const V=(e,{toastDesign:s,toastIntent:n})=>{if(!e)return{};const{design:l,intent:i,className:d,onClick:u,...o}=e;return{design:l??s,intent:i??A(n),className:c.cx("ml-auto",d),onClick:u,...o}},Y=(e,s,n)=>({swipeDirection:["down","right"],toast:e,className:c.cx(O({design:s,intent:n})),style:{"--gap":"var(--spacing-md)","--offset-y":"calc(var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) + var(--toast-swipe-movement-y))"}});function z(e){switch(e){case"info":return t.jsx(h.InfoFill,{});case"success":return t.jsx(P.ValidFill,{});case"alert":return t.jsx(M.WarningFill,{});case"error":return t.jsx(q.AlertFill,{});case"main":case"support":case"accent":case"basic":case"neutral":case"surface":case"surfaceInverse":default:return t.jsx(h.InfoFill,{})}}function R({toast:e}){const{icon:s,intent:n="info",design:l,action:i,isClosable:d,closeLabel:u="Close",compact:o=!1}=e.data??{},f="tinted",g=i?.close?r.Toast.Close:r.Toast.Action,p=V(i,{toastDesign:f,toastIntent:n}),x=Y(e,f,n),b=s??z(n),m=a=>d?t.jsx(r.Toast.Close,{className:a,render:t.jsx(N.IconButton,{"aria-label":u,design:f,intent:S(n),size:"md"}),children:t.jsx(w.Icon,{children:t.jsx(C.Close,{})})}):null,v=()=>{const a=e.data?.title??e.title,y=!!(e.data?.description??e.description);return typeof a!="string"&&a!==void 0?t.jsx(r.Toast.Title,{className:y?"text-headline-2":"text-body-1",render:t.jsx("div",{}),children:a}):t.jsx(r.Toast.Title,{className:y?"text-headline-2":"text-body-1"})},T=()=>{const a=e.data?.description??e.description;return a?typeof a!="string"?t.jsx(r.Toast.Description,{className:"text-body-1",render:t.jsx("div",{}),children:a}):t.jsx(r.Toast.Description,{className:"text-body-1"}):null};return t.jsx(r.Toast.Root,{...x,children:t.jsxs("div",{className:c.cx("flex",o?"gap-lg items-center":"gap-md flex-col"),children:[t.jsxs("div",{className:"gap-lg p-md flex grow items-center",children:[t.jsx(w.Icon,{size:"md",children:b}),t.jsxs("div",{className:c.cx("gap-sm flex flex-col",o&&"flex-1",!o&&d&&"pr-3xl"),children:[v(),T()]})]}),t.jsxs("div",{className:c.cx("flex"),children:[i&&t.jsx(g,{render:t.jsx(I.Button,{...p}),children:i.label}),o&&m()]}),!o&&m("top-md right-md absolute")]})},e.id)}function j(){const e=r.Toast.useToastManager(),s=B.useCallback(()=>{e.toasts.forEach(({id:n})=>e.close(n))},[e]);return{...e,closeAll:s}}function k(){const{toasts:e}=j();return e.map(s=>t.jsx(R,{toast:s},s.id))}function X({children:e,limit:s=3,...n}){return t.jsxs(r.Toast.Provider,{limit:s,...n,children:[t.jsx(r.Toast.Portal,{children:t.jsx(r.Toast.Viewport,{className:c.cx("z-toast right-lg bottom-lg text-on-surfa- fixed top-auto mx-auto flex w-fit flex-col items-end"),children:t.jsx(k,{})})}),e]})}function L({children:e,onClick:s,asChild:n=!1,title:l,description:i,timeout:d=5e3,design:u="filled",intent:o="neutral",isClosable:f=!0,icon:g,action:p,compact:x,priority:b="low"}){const m=j(),v=n?_.Slot:"button";function T(a){s?.(a),m.add({title:l,description:i,timeout:d,priority:b,data:{design:u,intent:o,isClosable:f,...g&&{icon:g},action:p,...x!==void 0&&{compact:x}}})}return t.jsx(v,{...!n&&{type:"button"},onClick:T,children:e})}const W=r.Toast.createToastManager;exports.ToastProvider=X;exports.ToastTrigger=L;exports.createToastManager=W;exports.useToastManager=j;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/toast/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { Toast as a } from "@base-ui/react/toast";
|
|
3
3
|
import { S as C } from "../Slot-DLY1rJrG.mjs";
|
|
4
4
|
import { cva as T, cx as l } from "class-variance-authority";
|
|
5
|
-
import { B } from "../Button-
|
|
5
|
+
import { B } from "../Button-DPncfbbM.mjs";
|
|
6
6
|
import { I as _ } from "../Icon-C23-htlD.mjs";
|
|
7
|
-
import { I as D } from "../IconButton-
|
|
7
|
+
import { I as D } from "../IconButton-Bfd-6BAD.mjs";
|
|
8
8
|
import { AlertFill as P } from "@spark-ui/icons/AlertFill";
|
|
9
9
|
import { Close as M } from "@spark-ui/icons/Close";
|
|
10
10
|
import { InfoFill as I } from "@spark-ui/icons/InfoFill";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-ui/components",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Spark (Leboncoin design system) components.",
|
|
6
6
|
"exports": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@react-aria/toast": "^3.0.0-beta.18",
|
|
55
55
|
"@react-stately/numberfield": "3.9.11",
|
|
56
56
|
"@react-stately/toast": "^3.0.0-beta.7",
|
|
57
|
-
"@spark-ui/hooks": "^16.
|
|
58
|
-
"@spark-ui/icons": "^16.
|
|
59
|
-
"@spark-ui/internal-utils": "^16.
|
|
57
|
+
"@spark-ui/hooks": "^16.2.0",
|
|
58
|
+
"@spark-ui/icons": "^16.2.0",
|
|
59
|
+
"@spark-ui/internal-utils": "^16.2.0",
|
|
60
60
|
"@zag-js/pagination": "1.30.0",
|
|
61
61
|
"@zag-js/react": "1.30.0",
|
|
62
62
|
"class-variance-authority": "0.7.1",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("react/jsx-runtime"),l=require("./Button-BIAkZTRR.js"),m=require("@spark-ui/internal-utils"),d=require("class-variance-authority"),p=d.cva(["pl-0 pr-0"],{variants:{size:m.makeVariants({sm:["text-body-1"],md:["text-body-1"],lg:["text-display-3"]})}}),n=({design:e="filled",disabled:o=!1,intent:s="main",shape:a="pill",size:t="md",className:i,ref:r,...c})=>u.jsx(l.Button,{"data-spark-component":"icon-button",ref:r,className:p({size:t,className:i}),design:e,disabled:o,intent:s,shape:a,size:t,...c});n.displayName="IconButton";exports.IconButton=n;
|
|
2
|
-
//# sourceMappingURL=IconButton-D5fk89W-.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton-D5fk89W-.js","sources":["../src/icon-button/IconButton.styles.tsx","../src/icon-button/IconButton.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'pill',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n"],"names":["iconButtonStyles","cva","makeVariants","IconButton","design","disabled","intent","shape","size","className","ref","others","jsx","Button"],"mappings":"gKAIaA,EAAmBC,EAAAA,IAAI,CAAC,WAAW,EAAG,CACjD,SAAU,CAIR,KAAMC,EAAAA,aAAyC,CAC7C,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,aAAa,EAClB,GAAI,CAAC,gBAAgB,CAAA,CACtB,CAAA,CAEL,CAAC,ECLYC,EAAa,CAAC,CACzB,OAAAC,EAAS,SACT,SAAAC,EAAW,GACX,OAAAC,EAAS,OACT,MAAAC,EAAQ,OACR,KAAAC,EAAO,KACP,UAAAC,EACA,IAAAC,EACA,GAAGC,CACL,IAEIC,EAAAA,IAACC,EAAAA,OAAA,CACC,uBAAqB,cACrB,IAAAH,EACA,UAAWV,EAAiB,CAAE,KAAAQ,EAAM,UAAAC,EAAW,EAC/C,OAAAL,EACA,SAAAC,EACA,OAAAC,EACA,MAAAC,EACA,KAAAC,EACC,GAAGG,CAAA,CAAA,EAKVR,EAAW,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton-Mv9tO1ZH.mjs","sources":["../src/icon-button/IconButton.styles.tsx","../src/icon-button/IconButton.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'pill',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n"],"names":["iconButtonStyles","cva","makeVariants","IconButton","design","disabled","intent","shape","size","className","ref","others","jsx","Button"],"mappings":";;;;AAIO,MAAMA,IAAmBC,EAAI,CAAC,WAAW,GAAG;AAAA,EACjD,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,MAAMC,EAAyC;AAAA,MAC7C,IAAI,CAAC,aAAa;AAAA,MAClB,IAAI,CAAC,aAAa;AAAA,MAClB,IAAI,CAAC,gBAAgB;AAAA,IAAA,CACtB;AAAA,EAAA;AAEL,CAAC,GCLYC,IAAa,CAAC;AAAA,EACzB,QAAAC,IAAS;AAAA,EACT,UAAAC,IAAW;AAAA,EACX,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,KAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,wBAAqB;AAAA,IACrB,KAAAH;AAAA,IACA,WAAWV,EAAiB,EAAE,MAAAQ,GAAM,WAAAC,GAAW;AAAA,IAC/C,QAAAL;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACC,GAAGG;AAAA,EAAA;AAAA;AAKVR,EAAW,cAAc;"}
|