@spark-ui/components 17.2.3-beta.1 → 17.2.4-beta.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/DialogContent.styles-BSxCCi-u.mjs +62 -0
- package/dist/DialogContent.styles-BSxCCi-u.mjs.map +1 -0
- package/dist/DialogContent.styles-CAhJtUud.js +2 -0
- package/dist/DialogContent.styles-CAhJtUud.js.map +1 -0
- package/dist/FormFieldRequiredIndicator-CtgkvPZo.js +2 -0
- package/dist/FormFieldRequiredIndicator-CtgkvPZo.js.map +1 -0
- package/dist/FormFieldRequiredIndicator-DOGQ_HxO.mjs +14 -0
- package/dist/FormFieldRequiredIndicator-DOGQ_HxO.mjs.map +1 -0
- package/dist/accordion/index.js +2 -2
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +99 -161
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert-dialog/index.js +2 -2
- package/dist/alert-dialog/index.js.map +1 -1
- package/dist/alert-dialog/index.mjs +169 -235
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/avatar/index.js +2 -2
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs +187 -224
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/badge/index.js +2 -2
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +115 -81
- package/dist/badge/index.mjs.map +1 -1
- package/dist/breadcrumb/index.js +2 -2
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +73 -106
- package/dist/breadcrumb/index.mjs.map +1 -1
- package/dist/button/index.js +1 -2
- package/dist/button/index.mjs +2 -5
- package/dist/button-BTDRzvpB.js +2 -0
- package/dist/button-BTDRzvpB.js.map +1 -0
- package/dist/button-_YZ_4J42.mjs +643 -0
- package/dist/button-_YZ_4J42.mjs.map +1 -0
- package/dist/card/index.js +2 -2
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +327 -394
- package/dist/card/index.mjs.map +1 -1
- package/dist/carousel/index.js +2 -2
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +515 -618
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/checkbox/index.js +2 -2
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +213 -246
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chip/index.js +2 -2
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +601 -652
- package/dist/chip/index.mjs.map +1 -1
- package/dist/chunk-C91j1N6u.js +1 -0
- package/dist/circular-meter/index.js +2 -2
- package/dist/circular-meter/index.js.map +1 -1
- package/dist/circular-meter/index.mjs +354 -309
- package/dist/circular-meter/index.mjs.map +1 -1
- package/dist/collapsible/index.js +2 -2
- package/dist/collapsible/index.js.map +1 -1
- package/dist/collapsible/index.mjs +53 -53
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/combobox/index.js +2 -2
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +721 -876
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dialog/index.js +2 -2
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +181 -206
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/divider/index.js +2 -2
- package/dist/divider/index.js.map +1 -1
- package/dist/divider/index.mjs +178 -183
- package/dist/divider/index.mjs.map +1 -1
- package/dist/drawer/index.js +2 -2
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +277 -309
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown/index.js +2 -2
- package/dist/dropdown/index.js.map +1 -1
- package/dist/dropdown/index.mjs +429 -492
- package/dist/dropdown/index.mjs.map +1 -1
- package/dist/file-upload/index.js +2 -2
- package/dist/file-upload/index.js.map +1 -1
- package/dist/file-upload/index.mjs +540 -677
- package/dist/file-upload/index.mjs.map +1 -1
- package/dist/form-field/index.js +1 -2
- package/dist/form-field/index.mjs +2 -284
- package/dist/form-field-B8QzM655.mjs +231 -0
- package/dist/form-field-B8QzM655.mjs.map +1 -0
- package/dist/form-field-Bu_0E9tb.js +2 -0
- package/dist/form-field-Bu_0E9tb.js.map +1 -0
- package/dist/icon/index.js +1 -2
- package/dist/icon/index.mjs +2 -5
- package/dist/icon-CRPcdgYp.js +2 -0
- package/dist/icon-CRPcdgYp.js.map +1 -0
- package/dist/icon-D05Uqh8_.mjs +41 -0
- package/dist/icon-D05Uqh8_.mjs.map +1 -0
- package/dist/icon-button/index.js +1 -2
- package/dist/icon-button/index.mjs +2 -5
- package/dist/icon-button-6p3O7NIm.mjs +28 -0
- package/dist/icon-button-6p3O7NIm.mjs.map +1 -0
- package/dist/icon-button-CykysbgJ.js +2 -0
- package/dist/icon-button-CykysbgJ.js.map +1 -0
- package/dist/input/index.js +1 -2
- package/dist/input/index.mjs +2 -455
- package/dist/input-CmYeHYWQ.mjs +355 -0
- package/dist/input-CmYeHYWQ.mjs.map +1 -0
- package/dist/input-DNr40G2Z.js +2 -0
- package/dist/input-DNr40G2Z.js.map +1 -0
- package/dist/input-otp/index.js +2 -2
- package/dist/input-otp/index.js.map +1 -1
- package/dist/input-otp/index.mjs +344 -407
- package/dist/input-otp/index.mjs.map +1 -1
- package/dist/kbd/index.js +2 -2
- package/dist/kbd/index.js.map +1 -1
- package/dist/kbd/index.mjs +12 -17
- package/dist/kbd/index.mjs.map +1 -1
- package/dist/label/index.js +1 -2
- package/dist/label/index.mjs +2 -40
- package/dist/label-BqRlrca0.mjs +31 -0
- package/dist/label-BqRlrca0.mjs.map +1 -0
- package/dist/label-DU0p0d-f.js +2 -0
- package/dist/label-DU0p0d-f.js.map +1 -0
- package/dist/link-box/index.js +2 -2
- package/dist/link-box/index.js.map +1 -1
- package/dist/link-box/index.mjs +36 -34
- package/dist/link-box/index.mjs.map +1 -1
- package/dist/meter/index.js +2 -2
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.mjs +149 -171
- package/dist/meter/index.mjs.map +1 -1
- package/dist/pagination/index.js +2 -2
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs +253 -214
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/popover/index.js +1 -2
- package/dist/popover/index.mjs +2 -239
- package/dist/popover-CxZAQmw6.mjs +211 -0
- package/dist/popover-CxZAQmw6.mjs.map +1 -0
- package/dist/popover-GOovJ27J.js +2 -0
- package/dist/popover-GOovJ27J.js.map +1 -0
- package/dist/portal/index.js +2 -2
- package/dist/portal/index.js.map +1 -1
- package/dist/portal/index.mjs +8 -7
- package/dist/portal/index.mjs.map +1 -1
- package/dist/progress/index.js +1 -2
- package/dist/progress/index.mjs +2 -178
- package/dist/progress-cEf3tFbn.mjs +132 -0
- package/dist/progress-cEf3tFbn.mjs.map +1 -0
- package/dist/progress-rJZcPJsZ.js +2 -0
- package/dist/progress-rJZcPJsZ.js.map +1 -0
- package/dist/progress-tracker/index.js +2 -2
- package/dist/progress-tracker/index.js.map +1 -1
- package/dist/progress-tracker/index.mjs +303 -380
- package/dist/progress-tracker/index.mjs.map +1 -1
- package/dist/radio-group/index.js +2 -2
- package/dist/radio-group/index.js.map +1 -1
- package/dist/radio-group/index.mjs +204 -213
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/rating/index.js +2 -2
- package/dist/rating/index.js.map +1 -1
- package/dist/rating/index.mjs +189 -244
- package/dist/rating/index.mjs.map +1 -1
- package/dist/rating-display/index.js +2 -2
- package/dist/rating-display/index.js.map +1 -1
- package/dist/rating-display/index.mjs +165 -166
- package/dist/rating-display/index.mjs.map +1 -1
- package/dist/scrolling-list/index.js +2 -2
- package/dist/scrolling-list/index.js.map +1 -1
- package/dist/scrolling-list/index.mjs +216 -273
- package/dist/scrolling-list/index.mjs.map +1 -1
- package/dist/segmented-control/index.js +2 -2
- package/dist/segmented-control/index.js.map +1 -1
- package/dist/segmented-control/index.mjs +146 -180
- package/dist/segmented-control/index.mjs.map +1 -1
- package/dist/segmented-gauge/index.js +2 -2
- package/dist/segmented-gauge/index.js.map +1 -1
- package/dist/segmented-gauge/index.mjs +146 -195
- package/dist/segmented-gauge/index.mjs.map +1 -1
- package/dist/select/index.js +2 -2
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +279 -327
- package/dist/select/index.mjs.map +1 -1
- package/dist/skeleton/index.js +2 -2
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs +92 -114
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/slider/index.js +2 -2
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs +259 -326
- package/dist/slider/index.mjs.map +1 -1
- package/dist/slot/index.js +2 -2
- package/dist/slot/index.js.map +1 -1
- package/dist/slot/index.mjs +12 -7
- package/dist/slot/index.mjs.map +1 -1
- package/dist/snackbar/index.js +2 -2
- package/dist/snackbar/index.js.map +1 -1
- package/dist/snackbar/index.mjs +404 -529
- package/dist/snackbar/index.mjs.map +1 -1
- package/dist/spinner/index.js +1 -2
- package/dist/spinner/index.mjs +2 -5
- package/dist/spinner-DFUoYvmm.js +2 -0
- package/dist/spinner-DFUoYvmm.js.map +1 -0
- package/dist/spinner-DULLiM6a.mjs +56 -0
- package/dist/spinner-DULLiM6a.mjs.map +1 -0
- package/dist/src/avatar/index.d.mts +2 -2
- package/dist/src/avatar/index.d.ts +2 -2
- package/dist/src/file-upload/index.d.mts +1 -1
- package/dist/src/file-upload/index.d.ts +1 -1
- package/dist/stepper/index.js +2 -2
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/index.mjs +139 -176
- package/dist/stepper/index.mjs.map +1 -1
- package/dist/switch/index.js +2 -2
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +194 -197
- package/dist/switch/index.mjs.map +1 -1
- package/dist/tabs/index.js +2 -2
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +337 -389
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tag/index.js +2 -2
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/index.mjs +192 -211
- package/dist/tag/index.mjs.map +1 -1
- package/dist/text-link/index.js +2 -2
- package/dist/text-link/index.js.map +1 -1
- package/dist/text-link/index.mjs +44 -5
- package/dist/text-link/index.mjs.map +1 -1
- package/dist/textarea/index.js +2 -2
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +51 -50
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.js +2 -2
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +314 -367
- package/dist/toast/index.mjs.map +1 -1
- package/dist/useRenderSlot-DP4fYerF.mjs +11 -0
- package/dist/useRenderSlot-DP4fYerF.mjs.map +1 -0
- package/dist/useRenderSlot-Xxf_s88b.js +2 -0
- package/dist/useRenderSlot-Xxf_s88b.js.map +1 -0
- package/dist/visually-hidden/index.js +2 -2
- package/dist/visually-hidden/index.js.map +1 -1
- package/dist/visually-hidden/index.mjs +25 -5
- package/dist/visually-hidden/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/Button-1M9DcZl0.mjs +0 -704
- package/dist/Button-1M9DcZl0.mjs.map +0 -1
- package/dist/Button-FZceRWG2.js +0 -2
- package/dist/Button-FZceRWG2.js.map +0 -1
- package/dist/DialogContent.styles-CziMQtYr.js +0 -2
- package/dist/DialogContent.styles-CziMQtYr.js.map +0 -1
- package/dist/DialogContent.styles-Du7_Dkde.mjs +0 -60
- package/dist/DialogContent.styles-Du7_Dkde.mjs.map +0 -1
- package/dist/FormFieldRequiredIndicator-CHfcoT2y.js +0 -2
- package/dist/FormFieldRequiredIndicator-CHfcoT2y.js.map +0 -1
- package/dist/FormFieldRequiredIndicator-DTnCGiX2.mjs +0 -13
- package/dist/FormFieldRequiredIndicator-DTnCGiX2.mjs.map +0 -1
- package/dist/Icon-BO327oHU.mjs +0 -57
- package/dist/Icon-BO327oHU.mjs.map +0 -1
- package/dist/Icon-C-cNTnzd.js +0 -2
- package/dist/Icon-C-cNTnzd.js.map +0 -1
- package/dist/IconButton-BR1bJSQA.js +0 -2
- package/dist/IconButton-BR1bJSQA.js.map +0 -1
- package/dist/IconButton-DdB3Pq13.mjs +0 -43
- package/dist/IconButton-DdB3Pq13.mjs.map +0 -1
- package/dist/Slot-DLY1rJrG.mjs +0 -14
- package/dist/Slot-DLY1rJrG.mjs.map +0 -1
- package/dist/Slot-DQ8z2zsy.js +0 -2
- package/dist/Slot-DQ8z2zsy.js.map +0 -1
- package/dist/Spinner-Br4Rp9V2.js +0 -2
- package/dist/Spinner-Br4Rp9V2.js.map +0 -1
- package/dist/Spinner-Co3AjkQV.mjs +0 -68
- package/dist/Spinner-Co3AjkQV.mjs.map +0 -1
- package/dist/TextLink-5MvP0P8D.js +0 -2
- package/dist/TextLink-5MvP0P8D.js.map +0 -1
- package/dist/TextLink-Cc_LeVcx.mjs +0 -57
- package/dist/TextLink-Cc_LeVcx.mjs.map +0 -1
- package/dist/VisuallyHidden-CB6Nx76j.js +0 -2
- package/dist/VisuallyHidden-CB6Nx76j.js.map +0 -1
- package/dist/VisuallyHidden-DjlV0-CW.mjs +0 -28
- package/dist/VisuallyHidden-DjlV0-CW.mjs.map +0 -1
- package/dist/button/index.js.map +0 -1
- package/dist/button/index.mjs.map +0 -1
- package/dist/form-field/index.js.map +0 -1
- package/dist/form-field/index.mjs.map +0 -1
- package/dist/icon/index.js.map +0 -1
- package/dist/icon/index.mjs.map +0 -1
- package/dist/icon-button/index.js.map +0 -1
- package/dist/icon-button/index.mjs.map +0 -1
- package/dist/input/index.js.map +0 -1
- package/dist/input/index.mjs.map +0 -1
- package/dist/label/index.js.map +0 -1
- package/dist/label/index.mjs.map +0 -1
- package/dist/popover/index.js.map +0 -1
- package/dist/popover/index.mjs.map +0 -1
- package/dist/progress/index.js.map +0 -1
- package/dist/progress/index.mjs.map +0 -1
- package/dist/spinner/index.js.map +0 -1
- package/dist/spinner/index.mjs.map +0 -1
- package/dist/useRenderSlot-Bta2kdp4.mjs +0 -10
- package/dist/useRenderSlot-Bta2kdp4.mjs.map +0 -1
- package/dist/useRenderSlot-DATwjgpo.js +0 -2
- package/dist/useRenderSlot-DATwjgpo.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-CRPcdgYp.js","names":[],"sources":["../src/icon/Icon.styles.tsx","../src/icon/Icon.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n ['current', 'main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n"],"mappings":"+MAGA,IAAa,GAAA,EAAA,EAAA,KAAiB,CAAC,wBAAwB,CAAE,CACvD,SAAU,CAIR,QAAA,EAAA,EAAA,cAGE,CACA,QAAS,CAAC,eAAe,CACzB,KAAM,CAAC,YAAY,CACnB,QAAS,CAAC,eAAe,CACzB,OAAQ,CAAC,cAAc,CACvB,QAAS,CAAC,eAAe,CACzB,MAAO,CAAC,aAAa,CACrB,MAAO,CAAC,aAAa,CACrB,KAAM,CAAC,YAAY,CACnB,QAAS,CAAC,eAAe,CAC1B,CAAC,CAIF,MAAA,EAAA,EAAA,cAAgE,CAC9D,QAAS,CAAC,sBAAsB,CAChC,GAAI,CAAC,UAAW,UAAU,CAC1B,GAAI,CAAC,UAAW,UAAU,CAC1B,GAAI,CAAC,UAAW,UAAU,CAC1B,GAAI,CAAC,UAAW,UAAU,CAC3B,CAAC,CACH,CACF,CAAC,CChBW,GAAQ,CACnB,QACA,YACA,OAAO,UACP,SAAS,UACT,WACA,GAAG,MAKD,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EAAA,EAAA,EAAA,cAHY,EAAA,SAAS,KAAK,EAAS,CAIyB,CACxD,UAAW,EAAW,CAAE,YAAW,OAAM,SAAQ,CAAC,CAClD,uBAAwB,OACxB,cAAe,OACf,UAAW,QACX,GAAG,EACJ,CAAC,CAED,IAAS,EAAA,EAAA,KAAC,EAAA,eAAD,CAAA,SAAiB,EAAuB,CAAA,CACjD,CAAA,CAAA,CAIP,EAAK,YAAc"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { VisuallyHidden as e } from "./visually-hidden/index.mjs";
|
|
2
|
+
import { cva as t } from "class-variance-authority";
|
|
3
|
+
import { Children as n, cloneElement as r } from "react";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { makeVariants as s } from "@spark-ui/internal-utils";
|
|
6
|
+
//#region src/icon/Icon.styles.tsx
|
|
7
|
+
var c = t(["fill-current shrink-0"], { variants: {
|
|
8
|
+
intent: s({
|
|
9
|
+
current: ["text-current"],
|
|
10
|
+
main: ["text-main"],
|
|
11
|
+
support: ["text-support"],
|
|
12
|
+
accent: ["text-accent"],
|
|
13
|
+
success: ["text-success"],
|
|
14
|
+
alert: ["text-alert"],
|
|
15
|
+
error: ["text-error"],
|
|
16
|
+
info: ["text-info"],
|
|
17
|
+
neutral: ["text-neutral"]
|
|
18
|
+
}),
|
|
19
|
+
size: s({
|
|
20
|
+
current: ["u-current-font-size"],
|
|
21
|
+
sm: ["w-sz-16", "h-sz-16"],
|
|
22
|
+
md: ["w-sz-24", "h-sz-24"],
|
|
23
|
+
lg: ["w-sz-32", "h-sz-32"],
|
|
24
|
+
xl: ["w-sz-40", "h-sz-40"]
|
|
25
|
+
})
|
|
26
|
+
} }), l = ({ label: t, className: s, size: l = "current", intent: u = "current", children: d, ...f }) => /* @__PURE__ */ o(i, { children: [r(n.only(d), {
|
|
27
|
+
className: c({
|
|
28
|
+
className: s,
|
|
29
|
+
size: l,
|
|
30
|
+
intent: u
|
|
31
|
+
}),
|
|
32
|
+
"data-spark-component": "icon",
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
focusable: "false",
|
|
35
|
+
...f
|
|
36
|
+
}), t && /* @__PURE__ */ a(e, { children: t })] });
|
|
37
|
+
l.displayName = "Icon";
|
|
38
|
+
//#endregion
|
|
39
|
+
export { l as t };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=icon-D05Uqh8_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-D05Uqh8_.mjs","names":[],"sources":["../src/icon/Icon.styles.tsx","../src/icon/Icon.tsx"],"sourcesContent":["import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n ['current', 'main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n"],"mappings":";;;;;;AAGA,IAAa,IAAa,EAAI,CAAC,wBAAwB,EAAE,EACvD,UAAU;CAIR,QAAQ,EAGN;EACA,SAAS,CAAC,eAAe;EACzB,MAAM,CAAC,YAAY;EACnB,SAAS,CAAC,eAAe;EACzB,QAAQ,CAAC,cAAc;EACvB,SAAS,CAAC,eAAe;EACzB,OAAO,CAAC,aAAa;EACrB,OAAO,CAAC,aAAa;EACrB,MAAM,CAAC,YAAY;EACnB,SAAS,CAAC,eAAe;EAC1B,CAAC;CAIF,MAAM,EAA0D;EAC9D,SAAS,CAAC,sBAAsB;EAChC,IAAI,CAAC,WAAW,UAAU;EAC1B,IAAI,CAAC,WAAW,UAAU;EAC1B,IAAI,CAAC,WAAW,UAAU;EAC1B,IAAI,CAAC,WAAW,UAAU;EAC3B,CAAC;CACH,EACF,CAAC,EChBW,KAAQ,EACnB,UACA,cACA,UAAO,WACP,YAAS,WACT,aACA,GAAG,QAKD,kBAAA,GAAA,EAAA,UAAA,CACG,EAJS,EAAS,KAAK,EAAS,EAIyB;CACxD,WAAW,EAAW;EAAE;EAAW;EAAM;EAAQ,CAAC;CAClD,wBAAwB;CACxB,eAAe;CACf,WAAW;CACX,GAAG;CACJ,CAAC,EAED,KAAS,kBAAC,GAAD,EAAA,UAAiB,GAAuB,CAAA,CACjD,EAAA,CAAA;AAIP,EAAK,cAAc"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icon-button-CykysbgJ.js`);exports.IconButton=e.t;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { t as e } from "./button-_YZ_4J42.mjs";
|
|
2
|
+
import { cva as t } from "class-variance-authority";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { makeVariants as r } from "@spark-ui/internal-utils";
|
|
5
|
+
//#region src/icon-button/IconButton.styles.tsx
|
|
6
|
+
var i = t(["pl-0 pr-0"], { variants: { size: r({
|
|
7
|
+
sm: ["text-body-1"],
|
|
8
|
+
md: ["text-body-1"],
|
|
9
|
+
lg: ["text-display-3"]
|
|
10
|
+
}) } }), a = ({ design: t = "filled", disabled: r = !1, intent: a = "main", shape: o = "rounded", size: s = "md", className: c, ref: l, ...u }) => /* @__PURE__ */ n(e, {
|
|
11
|
+
"data-spark-component": "icon-button",
|
|
12
|
+
ref: l,
|
|
13
|
+
className: i({
|
|
14
|
+
size: s,
|
|
15
|
+
className: c
|
|
16
|
+
}),
|
|
17
|
+
design: t,
|
|
18
|
+
disabled: r,
|
|
19
|
+
intent: a,
|
|
20
|
+
shape: o,
|
|
21
|
+
size: s,
|
|
22
|
+
...u
|
|
23
|
+
});
|
|
24
|
+
a.displayName = "IconButton";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { a as t };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=icon-button-6p3O7NIm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button-6p3O7NIm.mjs","names":[],"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 = 'rounded',\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"],"mappings":";;;;;AAIA,IAAa,IAAmB,EAAI,CAAC,YAAY,EAAE,EACjD,UAAU,EAIR,MAAM,EAAyC;CAC7C,IAAI,CAAC,cAAc;CACnB,IAAI,CAAC,cAAc;CACnB,IAAI,CAAC,iBAAiB;CACvB,CAAC,EACH,EACF,CAAC,ECLW,KAAc,EACzB,YAAS,UACT,cAAW,IACX,YAAS,QACT,WAAQ,WACR,UAAO,MACP,cACA,QACA,GAAG,QAGD,kBAAC,GAAD;CACE,wBAAqB;CAChB;CACL,WAAW,EAAiB;EAAE;EAAM;EAAW,CAAC;CACxC;CACE;CACF;CACD;CACD;CACN,GAAI;CACJ,CAAA;AAIN,EAAW,cAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`./chunk-C91j1N6u.js`);const e=require(`./button-BTDRzvpB.js`);let t=require(`class-variance-authority`),n=require(`react/jsx-runtime`),r=require(`@spark-ui/internal-utils`);var i=(0,t.cva)([`pl-0 pr-0`],{variants:{size:(0,r.makeVariants)({sm:[`text-body-1`],md:[`text-body-1`],lg:[`text-display-3`]})}}),a=({design:t=`filled`,disabled:r=!1,intent:a=`main`,shape:o=`rounded`,size:s=`md`,className:c,ref:l,...u})=>(0,n.jsx)(e.t,{"data-spark-component":`icon-button`,ref:l,className:i({size:s,className:c}),design:t,disabled:r,intent:a,shape:o,size:s,...u});a.displayName=`IconButton`,Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
2
|
+
//# sourceMappingURL=icon-button-CykysbgJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button-CykysbgJ.js","names":[],"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 = 'rounded',\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"],"mappings":"sLAIA,IAAa,GAAA,EAAA,EAAA,KAAuB,CAAC,YAAY,CAAE,CACjD,SAAU,CAIR,MAAA,EAAA,EAAA,cAA+C,CAC7C,GAAI,CAAC,cAAc,CACnB,GAAI,CAAC,cAAc,CACnB,GAAI,CAAC,iBAAiB,CACvB,CAAC,CACH,CACF,CAAC,CCLW,GAAc,CACzB,SAAS,SACT,WAAW,GACX,SAAS,OACT,QAAQ,UACR,OAAO,KACP,YACA,MACA,GAAG,MAGD,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,uBAAqB,cAChB,MACL,UAAW,EAAiB,CAAE,OAAM,YAAW,CAAC,CACxC,SACE,WACF,SACD,QACD,OACN,GAAI,EACJ,CAAA,CAIN,EAAW,YAAc"}
|
package/dist/input/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../input-DNr40G2Z.js`);exports.Input=e.n,exports.InputGroup=e.t,exports.useInputGroup=e.r;
|
package/dist/input/index.mjs
CHANGED
|
@@ -1,455 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { cx as g, cva as S } from "class-variance-authority";
|
|
4
|
-
import { I as K } from "../Icon-BO327oHU.mjs";
|
|
5
|
-
import { createContext as ie, useContext as de, Children as P, isValidElement as ue, useRef as M, useCallback as ce, useMemo as pe, useEffect as fe, cloneElement as ge } from "react";
|
|
6
|
-
import { useFormFieldControl as H } from "@spark-ui/components/form-field";
|
|
7
|
-
import { useCombinedState as me } from "@spark-ui/hooks/use-combined-state";
|
|
8
|
-
import { useMergeRefs as he } from "@spark-ui/hooks/use-merge-refs";
|
|
9
|
-
import { S as J } from "../Slot-DLY1rJrG.mjs";
|
|
10
|
-
const Q = ie(null), v = () => de(Q) || { isStandalone: !0 }, U = ({
|
|
11
|
-
className: n,
|
|
12
|
-
tabIndex: e = -1,
|
|
13
|
-
onClick: t,
|
|
14
|
-
inline: r = !1,
|
|
15
|
-
ref: o,
|
|
16
|
-
...s
|
|
17
|
-
}) => {
|
|
18
|
-
const { onClear: i, hasTrailingIcon: m } = v(), d = (a) => {
|
|
19
|
-
t && t(a), i && i();
|
|
20
|
-
};
|
|
21
|
-
return /* @__PURE__ */ l(
|
|
22
|
-
"button",
|
|
23
|
-
{
|
|
24
|
-
ref: o,
|
|
25
|
-
"data-spark-component": "input-clear-button",
|
|
26
|
-
className: g(
|
|
27
|
-
n,
|
|
28
|
-
"pointer-events-auto absolute",
|
|
29
|
-
r ? "h-sz-44 top-0 -translate-y-0" : "top-1/2 -translate-y-1/2",
|
|
30
|
-
"inline-flex h-full items-center justify-center outline-hidden",
|
|
31
|
-
"text-neutral hover:text-neutral-hovered",
|
|
32
|
-
m ? "right-3xl px-sz-12" : "pl-md pr-lg right-0"
|
|
33
|
-
),
|
|
34
|
-
tabIndex: e,
|
|
35
|
-
onClick: d,
|
|
36
|
-
type: "button",
|
|
37
|
-
...s,
|
|
38
|
-
children: /* @__PURE__ */ l(K, { size: "sm", children: /* @__PURE__ */ l(le, {}) })
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}, W = Object.assign(U, {
|
|
42
|
-
id: "ClearButton"
|
|
43
|
-
});
|
|
44
|
-
U.displayName = "InputGroup.ClearButton";
|
|
45
|
-
const Ie = S(["relative inline-flex w-full"], {
|
|
46
|
-
variants: {
|
|
47
|
-
/**
|
|
48
|
-
* When `true`, prevents the user from interacting.
|
|
49
|
-
*/
|
|
50
|
-
disabled: {
|
|
51
|
-
true: [
|
|
52
|
-
"cursor-not-allowed",
|
|
53
|
-
"relative",
|
|
54
|
-
"after:absolute",
|
|
55
|
-
"after:top-0",
|
|
56
|
-
"after:h-full",
|
|
57
|
-
"after:w-full",
|
|
58
|
-
"after:border-sm after:border-outline",
|
|
59
|
-
"after:rounded-lg"
|
|
60
|
-
],
|
|
61
|
-
false: "after:hidden"
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* Sets the component as interactive or not.
|
|
65
|
-
*/
|
|
66
|
-
readOnly: {
|
|
67
|
-
true: [
|
|
68
|
-
"relative",
|
|
69
|
-
"after:absolute",
|
|
70
|
-
"after:top-0",
|
|
71
|
-
"after:h-full",
|
|
72
|
-
"after:w-full",
|
|
73
|
-
"after:border-sm after:border-outline",
|
|
74
|
-
"after:rounded-lg"
|
|
75
|
-
],
|
|
76
|
-
false: "after:hidden"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}), X = ({
|
|
80
|
-
className: n,
|
|
81
|
-
children: e,
|
|
82
|
-
state: t,
|
|
83
|
-
disabled: r,
|
|
84
|
-
readOnly: o,
|
|
85
|
-
onClear: s,
|
|
86
|
-
ref: i,
|
|
87
|
-
...m
|
|
88
|
-
}) => {
|
|
89
|
-
const d = (y) => y ? y.type.id : "", a = (...y) => c.find((se) => y.includes(d(se) || "")), c = P.toArray(e).filter(ue), p = a("Input"), f = p?.props || {}, h = M(null), x = M(s), V = he(p?.ref, h), [T, C] = me(
|
|
90
|
-
f.value,
|
|
91
|
-
f.defaultValue,
|
|
92
|
-
f.onValueChange
|
|
93
|
-
), N = H(), L = N.state ?? t, I = N.disabled || !!r, b = N.readOnly || !!o, O = a("LeadingAddon"), G = a("LeadingIcon"), B = a("ClearButton"), w = a("TrailingIcon"), k = a("TrailingAddon"), A = !!O, u = !!k, _ = !!G, $ = !!w, z = !!T && !!B && !I && !b, ae = (y) => {
|
|
94
|
-
f.onChange && f.onChange(y), C(y.target.value);
|
|
95
|
-
}, q = ce(() => {
|
|
96
|
-
x.current && x.current(), C(""), h.current.focus();
|
|
97
|
-
}, [C]), re = pe(() => ({
|
|
98
|
-
state: L,
|
|
99
|
-
disabled: I,
|
|
100
|
-
readOnly: b,
|
|
101
|
-
hasLeadingIcon: _,
|
|
102
|
-
hasTrailingIcon: $,
|
|
103
|
-
hasLeadingAddon: A,
|
|
104
|
-
hasTrailingAddon: u,
|
|
105
|
-
hasClearButton: z,
|
|
106
|
-
onClear: q
|
|
107
|
-
}), [
|
|
108
|
-
L,
|
|
109
|
-
I,
|
|
110
|
-
b,
|
|
111
|
-
_,
|
|
112
|
-
$,
|
|
113
|
-
A,
|
|
114
|
-
u,
|
|
115
|
-
z,
|
|
116
|
-
q
|
|
117
|
-
]);
|
|
118
|
-
fe(() => {
|
|
119
|
-
x.current = s;
|
|
120
|
-
}, [s]);
|
|
121
|
-
const oe = h.current?.value;
|
|
122
|
-
return /* @__PURE__ */ l(Q.Provider, { value: re, children: /* @__PURE__ */ F(
|
|
123
|
-
"div",
|
|
124
|
-
{
|
|
125
|
-
"data-spark-component": "input-group",
|
|
126
|
-
ref: i,
|
|
127
|
-
className: Ie({ disabled: I, readOnly: b, className: n }),
|
|
128
|
-
...m,
|
|
129
|
-
children: [
|
|
130
|
-
A && O,
|
|
131
|
-
/* @__PURE__ */ F("div", { className: "relative inline-flex w-full", children: [
|
|
132
|
-
p && ge(p, {
|
|
133
|
-
value: T ?? oe ?? "",
|
|
134
|
-
ref: V,
|
|
135
|
-
defaultValue: void 0,
|
|
136
|
-
onChange: ae
|
|
137
|
-
}),
|
|
138
|
-
G,
|
|
139
|
-
z && B,
|
|
140
|
-
w
|
|
141
|
-
] }),
|
|
142
|
-
u && k
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
) });
|
|
146
|
-
};
|
|
147
|
-
X.displayName = "InputGroup";
|
|
148
|
-
const be = S(
|
|
149
|
-
[
|
|
150
|
-
"overflow-hidden",
|
|
151
|
-
"border-sm",
|
|
152
|
-
"shrink-0",
|
|
153
|
-
"h-full",
|
|
154
|
-
"focus-visible:relative focus-visible:z-raised",
|
|
155
|
-
"mx-0"
|
|
156
|
-
],
|
|
157
|
-
{
|
|
158
|
-
variants: {
|
|
159
|
-
/**
|
|
160
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
161
|
-
*/
|
|
162
|
-
asChild: { false: ["flex", "items-center", "px-lg"] },
|
|
163
|
-
intent: {
|
|
164
|
-
neutral: "border-outline",
|
|
165
|
-
error: "border-error",
|
|
166
|
-
alert: "border-alert",
|
|
167
|
-
success: "border-success"
|
|
168
|
-
},
|
|
169
|
-
/**
|
|
170
|
-
* Disable the input addon, preventing user interaction and adding opacity.
|
|
171
|
-
*/
|
|
172
|
-
disabled: {
|
|
173
|
-
true: ["pointer-events-none border-outline!"]
|
|
174
|
-
},
|
|
175
|
-
/**
|
|
176
|
-
* Changes input addon styles based on the read only status from the input.
|
|
177
|
-
*/
|
|
178
|
-
readOnly: {
|
|
179
|
-
true: ["pointer-events-none"]
|
|
180
|
-
},
|
|
181
|
-
/**
|
|
182
|
-
* Main style of the input addon.
|
|
183
|
-
*/
|
|
184
|
-
design: {
|
|
185
|
-
text: "",
|
|
186
|
-
solid: "",
|
|
187
|
-
inline: ""
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
compoundVariants: [
|
|
191
|
-
{
|
|
192
|
-
disabled: !1,
|
|
193
|
-
readOnly: !1,
|
|
194
|
-
design: "text",
|
|
195
|
-
class: ["bg-surface", "text-on-surface"]
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
disabled: !0,
|
|
199
|
-
design: "text",
|
|
200
|
-
class: ["text-on-surface/dim-3"]
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
disabled: !0,
|
|
204
|
-
design: ["solid", "inline"],
|
|
205
|
-
class: ["opacity-dim-3"]
|
|
206
|
-
}
|
|
207
|
-
],
|
|
208
|
-
defaultVariants: {
|
|
209
|
-
intent: "neutral"
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
), E = ({
|
|
213
|
-
asChild: n,
|
|
214
|
-
className: e,
|
|
215
|
-
children: t,
|
|
216
|
-
ref: r,
|
|
217
|
-
...o
|
|
218
|
-
}) => {
|
|
219
|
-
const { state: s, disabled: i, readOnly: m } = v(), d = typeof t == "string", a = !!(!d && n), c = d ? t : P.only(t), p = a && !d ? J : "div", h = d ? "text" : a ? "solid" : "inline";
|
|
220
|
-
return /* @__PURE__ */ l(
|
|
221
|
-
p,
|
|
222
|
-
{
|
|
223
|
-
ref: r,
|
|
224
|
-
"data-spark-component": "input-addon",
|
|
225
|
-
className: be({
|
|
226
|
-
className: e,
|
|
227
|
-
intent: s,
|
|
228
|
-
disabled: i,
|
|
229
|
-
readOnly: m,
|
|
230
|
-
asChild: a,
|
|
231
|
-
design: h
|
|
232
|
-
}),
|
|
233
|
-
...i && { tabIndex: -1 },
|
|
234
|
-
...o,
|
|
235
|
-
children: c
|
|
236
|
-
}
|
|
237
|
-
);
|
|
238
|
-
};
|
|
239
|
-
E.displayName = "InputGroup.Addon";
|
|
240
|
-
const Y = ({ className: n, ref: e, ...t }) => {
|
|
241
|
-
const { disabled: r, readOnly: o } = v();
|
|
242
|
-
return /* @__PURE__ */ l("div", { className: g("rounded-l-lg", r || o ? "bg-on-surface/dim-5" : null), children: /* @__PURE__ */ l(
|
|
243
|
-
E,
|
|
244
|
-
{
|
|
245
|
-
ref: e,
|
|
246
|
-
className: g(n, "rounded-r-0! mr-[-1px] rounded-l-lg"),
|
|
247
|
-
...t
|
|
248
|
-
}
|
|
249
|
-
) });
|
|
250
|
-
}, Z = Object.assign(Y, {
|
|
251
|
-
id: "LeadingAddon"
|
|
252
|
-
});
|
|
253
|
-
Y.displayName = "InputGroup.LeadingAddon";
|
|
254
|
-
const D = ({ className: n, intent: e, children: t, ...r }) => {
|
|
255
|
-
const { disabled: o, readOnly: s } = v();
|
|
256
|
-
return /* @__PURE__ */ l(
|
|
257
|
-
K,
|
|
258
|
-
{
|
|
259
|
-
"data-spark-component": "input-icon",
|
|
260
|
-
intent: e,
|
|
261
|
-
className: g(
|
|
262
|
-
n,
|
|
263
|
-
"pointer-events-none absolute top-[calc(var(--spacing-sz-44)/2)] -translate-y-1/2",
|
|
264
|
-
e ? void 0 : "text-neutral peer-focus:text-outline-high",
|
|
265
|
-
o || s ? "opacity-dim-3" : void 0
|
|
266
|
-
),
|
|
267
|
-
...r,
|
|
268
|
-
children: t
|
|
269
|
-
}
|
|
270
|
-
);
|
|
271
|
-
};
|
|
272
|
-
D.displayName = "InputGroup.Icon";
|
|
273
|
-
const R = ({ className: n, ...e }) => /* @__PURE__ */ l(D, { className: g(n, "left-lg text-body-1"), ...e });
|
|
274
|
-
R.id = "LeadingIcon";
|
|
275
|
-
R.displayName = "InputGroup.LeadingIcon";
|
|
276
|
-
const ee = ({ className: n, ref: e, ...t }) => {
|
|
277
|
-
const { disabled: r, readOnly: o } = v();
|
|
278
|
-
return /* @__PURE__ */ l("div", { className: g("rounded-r-lg", r || o ? "bg-on-surface/dim-5" : null), children: /* @__PURE__ */ l(
|
|
279
|
-
E,
|
|
280
|
-
{
|
|
281
|
-
ref: e,
|
|
282
|
-
className: g(n, "rounded-l-0! ml-[-1px] rounded-r-lg"),
|
|
283
|
-
...t
|
|
284
|
-
}
|
|
285
|
-
) });
|
|
286
|
-
}, ne = Object.assign(ee, {
|
|
287
|
-
id: "TrailingAddon"
|
|
288
|
-
});
|
|
289
|
-
ee.displayName = "InputGroup.TrailingAddon";
|
|
290
|
-
const j = ({ className: n, ...e }) => /* @__PURE__ */ l(D, { className: g(n, "right-lg text-body-1"), ...e });
|
|
291
|
-
j.id = "TrailingIcon";
|
|
292
|
-
j.displayName = "InputGroup.TrailingIcon";
|
|
293
|
-
const ye = S(
|
|
294
|
-
[
|
|
295
|
-
"relative",
|
|
296
|
-
"border-sm",
|
|
297
|
-
"peer",
|
|
298
|
-
"w-full",
|
|
299
|
-
"appearance-none outline-hidden",
|
|
300
|
-
"bg-surface",
|
|
301
|
-
"text-ellipsis text-body-1 text-on-surface",
|
|
302
|
-
"caret-neutral",
|
|
303
|
-
"[&:-webkit-autofill]:[-webkit-text-fill-color:var(--color-on-surface)]",
|
|
304
|
-
"autofill:shadow-surface autofill:shadow-[inset_0_0_0px_1000px]",
|
|
305
|
-
"disabled:cursor-not-allowed disabled:border-outline disabled:bg-on-surface/dim-5 disabled:text-on-surface/dim-3",
|
|
306
|
-
"read-only:cursor-default read-only:pointer-events-none read-only:bg-on-surface/dim-5",
|
|
307
|
-
"focus:ring-1 focus:ring-inset focus:ring-focus focus:border-focus"
|
|
308
|
-
],
|
|
309
|
-
{
|
|
310
|
-
variants: {
|
|
311
|
-
/**
|
|
312
|
-
* Change the component to the HTML tag or custom component of the only child.
|
|
313
|
-
*/
|
|
314
|
-
asChild: {
|
|
315
|
-
true: ["min-h-sz-44"],
|
|
316
|
-
false: ["h-sz-44"]
|
|
317
|
-
},
|
|
318
|
-
/**
|
|
319
|
-
* Color scheme of the button.
|
|
320
|
-
*/
|
|
321
|
-
intent: {
|
|
322
|
-
neutral: ["border-outline", "default:hover:border-outline-high"],
|
|
323
|
-
success: ["default:border-success"],
|
|
324
|
-
alert: ["default:border-alert"],
|
|
325
|
-
error: ["default:border-error"]
|
|
326
|
-
},
|
|
327
|
-
/**
|
|
328
|
-
* Sets if there is an addon before the input text.
|
|
329
|
-
*/
|
|
330
|
-
hasLeadingAddon: {
|
|
331
|
-
true: ["rounded-l-0"],
|
|
332
|
-
false: ["rounded-l-lg"]
|
|
333
|
-
},
|
|
334
|
-
/**
|
|
335
|
-
* Sets if there is an addon after the input text.
|
|
336
|
-
*/
|
|
337
|
-
hasTrailingAddon: {
|
|
338
|
-
true: ["rounded-r-0"],
|
|
339
|
-
false: ["rounded-r-lg"]
|
|
340
|
-
},
|
|
341
|
-
/**
|
|
342
|
-
* Sets if there is an icon before the input text.
|
|
343
|
-
*/
|
|
344
|
-
hasLeadingIcon: {
|
|
345
|
-
true: ["pl-3xl"],
|
|
346
|
-
false: ["pl-lg"]
|
|
347
|
-
},
|
|
348
|
-
/**
|
|
349
|
-
* Sets if there is an icon after the input text.
|
|
350
|
-
*/
|
|
351
|
-
hasTrailingIcon: { true: "" },
|
|
352
|
-
/**
|
|
353
|
-
* Sets if there is a button to clear the input text.
|
|
354
|
-
*/
|
|
355
|
-
hasClearButton: { true: "" }
|
|
356
|
-
},
|
|
357
|
-
compoundVariants: [
|
|
358
|
-
{
|
|
359
|
-
hasTrailingIcon: !1,
|
|
360
|
-
hasClearButton: !1,
|
|
361
|
-
class: "pr-lg"
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
hasTrailingIcon: !0,
|
|
365
|
-
hasClearButton: !1,
|
|
366
|
-
class: "pr-3xl"
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
hasTrailingIcon: !1,
|
|
370
|
-
hasClearButton: !0,
|
|
371
|
-
class: "pr-3xl"
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
hasTrailingIcon: !0,
|
|
375
|
-
hasClearButton: !0,
|
|
376
|
-
class: "pr-[calc(var(--spacing-3xl)*2)]"
|
|
377
|
-
}
|
|
378
|
-
],
|
|
379
|
-
defaultVariants: {
|
|
380
|
-
intent: "neutral"
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
), te = ({
|
|
384
|
-
className: n,
|
|
385
|
-
asChild: e = !1,
|
|
386
|
-
onValueChange: t,
|
|
387
|
-
onChange: r,
|
|
388
|
-
onKeyDown: o,
|
|
389
|
-
disabled: s,
|
|
390
|
-
readOnly: i,
|
|
391
|
-
ref: m,
|
|
392
|
-
...d
|
|
393
|
-
}) => {
|
|
394
|
-
const a = H(), c = v(), { id: p, name: f, isInvalid: h, isRequired: x, description: V } = a, {
|
|
395
|
-
hasLeadingAddon: T,
|
|
396
|
-
hasTrailingAddon: C,
|
|
397
|
-
hasLeadingIcon: N,
|
|
398
|
-
hasTrailingIcon: L,
|
|
399
|
-
hasClearButton: I,
|
|
400
|
-
onClear: b
|
|
401
|
-
} = c, O = e ? J : "input", G = a.state || c.state, B = a.disabled || c.disabled || s, w = a.readOnly || c.readOnly || i, k = (u) => {
|
|
402
|
-
r && r(u), t && t(u.target.value);
|
|
403
|
-
}, A = (u) => {
|
|
404
|
-
o && o(u), I && b && u.key === "Escape" && b();
|
|
405
|
-
};
|
|
406
|
-
return /* @__PURE__ */ l(
|
|
407
|
-
O,
|
|
408
|
-
{
|
|
409
|
-
"data-spark-component": "input",
|
|
410
|
-
ref: m,
|
|
411
|
-
id: p,
|
|
412
|
-
name: f,
|
|
413
|
-
className: ye({
|
|
414
|
-
asChild: e,
|
|
415
|
-
className: n,
|
|
416
|
-
intent: G,
|
|
417
|
-
hasLeadingAddon: !!T,
|
|
418
|
-
hasTrailingAddon: !!C,
|
|
419
|
-
hasLeadingIcon: !!N,
|
|
420
|
-
hasTrailingIcon: !!L,
|
|
421
|
-
hasClearButton: !!I
|
|
422
|
-
}),
|
|
423
|
-
disabled: B,
|
|
424
|
-
readOnly: w,
|
|
425
|
-
required: x,
|
|
426
|
-
"aria-describedby": V,
|
|
427
|
-
"aria-invalid": h,
|
|
428
|
-
onChange: k,
|
|
429
|
-
onKeyDown: A,
|
|
430
|
-
...d
|
|
431
|
-
}
|
|
432
|
-
);
|
|
433
|
-
}, we = Object.assign(te, {
|
|
434
|
-
id: "Input"
|
|
435
|
-
});
|
|
436
|
-
te.displayName = "Input";
|
|
437
|
-
const ve = Object.assign(X, {
|
|
438
|
-
LeadingAddon: Z,
|
|
439
|
-
TrailingAddon: ne,
|
|
440
|
-
LeadingIcon: R,
|
|
441
|
-
TrailingIcon: j,
|
|
442
|
-
ClearButton: W
|
|
443
|
-
});
|
|
444
|
-
ve.displayName = "InputGroup";
|
|
445
|
-
Z.displayName = "InputGroup.LeadingAddon";
|
|
446
|
-
ne.displayName = "InputGroup.TrailingAddon";
|
|
447
|
-
R.displayName = "InputGroup.LeadingIcon";
|
|
448
|
-
j.displayName = "InputGroup.TrailingIcon";
|
|
449
|
-
W.displayName = "InputGroup.ClearButton";
|
|
450
|
-
export {
|
|
451
|
-
we as Input,
|
|
452
|
-
ve as InputGroup,
|
|
453
|
-
v as useInputGroup
|
|
454
|
-
};
|
|
455
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import { n as e, r as t, t as n } from "../input-CmYeHYWQ.mjs";
|
|
2
|
+
export { e as Input, n as InputGroup, t as useInputGroup };
|