@dashx/react 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/button.d.ts +2 -1
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +3 -3
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +2 -2
- package/dist/cjs/components/checkbox.d.ts +18 -0
- package/dist/cjs/components/checkbox.js +2 -0
- package/dist/cjs/components/checkbox.js.map +7 -0
- package/dist/cjs/components/flex.d.ts +66 -49
- package/dist/cjs/components/flex.js +1 -1
- package/dist/cjs/components/flex.js.map +3 -3
- package/dist/cjs/components/form.d.ts +11 -0
- package/dist/cjs/components/form.js +2 -0
- package/dist/cjs/components/form.js.map +7 -0
- package/dist/cjs/components/index.d.ts +5 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/link.d.ts +10 -0
- package/dist/cjs/components/link.js +2 -0
- package/dist/cjs/components/link.js.map +7 -0
- package/dist/cjs/components/number-field.d.ts +11 -0
- package/dist/cjs/components/number-field.js +2 -0
- package/dist/cjs/components/number-field.js.map +7 -0
- package/dist/cjs/components/popover.d.ts +6 -6
- package/dist/cjs/components/text-area.d.ts +11 -0
- package/dist/cjs/components/text-area.js +2 -0
- package/dist/cjs/components/text-area.js.map +7 -0
- package/dist/cjs/components/text-field.d.ts +10 -1
- package/dist/cjs/components/text-field.js +1 -1
- package/dist/cjs/components/text-field.js.map +3 -3
- package/dist/cjs/components/text.d.ts +1 -1
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +3 -3
- package/dist/cjs/components/theme.d.ts +2 -0
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +3 -3
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/tooltip.js.map +2 -2
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.js +1 -1
- package/dist/cjs/hooks/index.js.map +3 -3
- package/dist/cjs/hooks/use-in-app.js +1 -1
- package/dist/cjs/hooks/use-in-app.js.map +3 -3
- package/dist/cjs/hooks/use-product-release.d.ts +6 -0
- package/dist/cjs/hooks/use-product-release.js +2 -0
- package/dist/cjs/hooks/use-product-release.js.map +7 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/providers/DashXProvider.d.ts +7 -2
- package/dist/cjs/providers/DashXProvider.js +1 -1
- package/dist/cjs/providers/DashXProvider.js.map +3 -3
- package/dist/cjs/providers/index.d.ts +1 -1
- package/dist/cjs/providers/index.js +1 -1
- package/dist/cjs/providers/index.js.map +2 -2
- package/dist/cjs/utils/helpers.d.ts +2 -0
- package/dist/cjs/utils/helpers.js +2 -0
- package/dist/cjs/utils/helpers.js.map +7 -0
- package/dist/cjs/variants/base-element.d.ts +25 -18
- package/dist/cjs/variants/base-element.js +1 -1
- package/dist/cjs/variants/base-element.js.map +2 -2
- package/dist/cjs/variants/base-field.d.ts +110 -0
- package/dist/cjs/variants/base-field.js +2 -0
- package/dist/cjs/variants/base-field.js.map +7 -0
- package/dist/cjs/variants/base-input.d.ts +5 -0
- package/dist/cjs/variants/base-input.js +2 -0
- package/dist/cjs/variants/base-input.js.map +7 -0
- package/dist/cjs/variants/button.d.ts +26 -54
- package/dist/cjs/variants/button.js +1 -1
- package/dist/cjs/variants/button.js.map +2 -2
- package/dist/cjs/variants/card.d.ts +2 -62
- package/dist/cjs/variants/card.js +1 -1
- package/dist/cjs/variants/card.js.map +2 -2
- package/dist/cjs/variants/checkbox.d.ts +23 -0
- package/dist/cjs/variants/checkbox.js +2 -0
- package/dist/cjs/variants/checkbox.js.map +7 -0
- package/dist/cjs/variants/field-error.d.ts +65 -0
- package/dist/cjs/variants/field-error.js +2 -0
- package/dist/cjs/variants/field-error.js.map +7 -0
- package/dist/cjs/variants/heading.d.ts +19 -205
- package/dist/cjs/variants/index.d.ts +2 -0
- package/dist/cjs/variants/index.js +1 -1
- package/dist/cjs/variants/index.js.map +2 -2
- package/dist/cjs/variants/link.d.ts +215 -0
- package/dist/cjs/variants/link.js +2 -0
- package/dist/cjs/variants/link.js.map +7 -0
- package/dist/cjs/variants/popover.d.ts +5 -61
- package/dist/cjs/variants/popover.js +1 -1
- package/dist/cjs/variants/popover.js.map +2 -2
- package/dist/cjs/variants/text-area.d.ts +141 -0
- package/dist/cjs/variants/text-area.js +2 -0
- package/dist/cjs/variants/text-area.js.map +7 -0
- package/dist/cjs/variants/text-field.d.ts +78 -30
- package/dist/cjs/variants/text-field.js +1 -1
- package/dist/cjs/variants/text-field.js.map +3 -3
- package/dist/cjs/variants/text.d.ts +20 -205
- package/dist/cjs/variants/text.js +1 -1
- package/dist/cjs/variants/text.js.map +2 -2
- package/dist/cjs/variants/tooltip.d.ts +1 -1
- package/dist/cjs/variants/tooltip.js +1 -1
- package/dist/cjs/variants/tooltip.js.map +2 -2
- package/dist/cjs/variants/typography.d.ts +14 -159
- package/dist/cjs/variants/typography.js +1 -1
- package/dist/cjs/variants/typography.js.map +2 -2
- package/dist/esm/components/button.d.ts +2 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +3 -3
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.js.map +2 -2
- package/dist/esm/components/checkbox.d.ts +18 -0
- package/dist/esm/components/checkbox.js +2 -0
- package/dist/esm/components/checkbox.js.map +7 -0
- package/dist/esm/components/flex.d.ts +321 -16
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/flex.js.map +3 -3
- package/dist/esm/components/form.d.ts +11 -0
- package/dist/esm/components/form.js +2 -0
- package/dist/esm/components/form.js.map +7 -0
- package/dist/esm/components/index.d.ts +5 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/link.d.ts +10 -0
- package/dist/esm/components/link.js +2 -0
- package/dist/esm/components/link.js.map +7 -0
- package/dist/esm/components/number-field.d.ts +11 -0
- package/dist/esm/components/number-field.js +2 -0
- package/dist/esm/components/number-field.js.map +7 -0
- package/dist/esm/components/popover.d.ts +6 -6
- package/dist/esm/components/text-area.d.ts +11 -0
- package/dist/esm/components/text-area.js +2 -0
- package/dist/esm/components/text-area.js.map +7 -0
- package/dist/esm/components/text-field.d.ts +10 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text-field.js.map +3 -3
- package/dist/esm/components/text.d.ts +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +3 -3
- package/dist/esm/components/theme.d.ts +2 -0
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/theme.js.map +3 -3
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/tooltip.js.map +2 -2
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/index.js.map +2 -2
- package/dist/esm/hooks/use-in-app.js +1 -1
- package/dist/esm/hooks/use-in-app.js.map +3 -3
- package/dist/esm/hooks/use-product-release.d.ts +6 -0
- package/dist/esm/hooks/use-product-release.js +2 -0
- package/dist/esm/hooks/use-product-release.js.map +7 -0
- package/dist/esm/providers/DashXProvider.d.ts +7 -2
- package/dist/esm/providers/DashXProvider.js +1 -1
- package/dist/esm/providers/DashXProvider.js.map +3 -3
- package/dist/esm/providers/index.d.ts +1 -1
- package/dist/esm/providers/index.js +1 -1
- package/dist/esm/providers/index.js.map +3 -3
- package/dist/esm/utils/helpers.d.ts +2 -0
- package/dist/esm/utils/helpers.js +2 -0
- package/dist/esm/utils/helpers.js.map +7 -0
- package/dist/esm/variants/base-element.d.ts +91 -0
- package/dist/esm/variants/base-element.js +1 -1
- package/dist/esm/variants/base-element.js.map +2 -2
- package/dist/esm/variants/base-field.d.ts +236 -0
- package/dist/esm/variants/base-field.js +2 -0
- package/dist/esm/variants/base-field.js.map +7 -0
- package/dist/esm/variants/base-input.d.ts +5 -0
- package/dist/esm/variants/base-input.js +2 -0
- package/dist/esm/variants/base-input.js.map +7 -0
- package/dist/esm/variants/button.d.ts +122 -15
- package/dist/esm/variants/button.js +1 -1
- package/dist/esm/variants/button.js.map +2 -2
- package/dist/esm/variants/card.d.ts +2 -2
- package/dist/esm/variants/card.js +1 -1
- package/dist/esm/variants/card.js.map +2 -2
- package/dist/esm/variants/checkbox.d.ts +41 -0
- package/dist/esm/variants/checkbox.js +2 -0
- package/dist/esm/variants/checkbox.js.map +7 -0
- package/dist/esm/variants/field-error.d.ts +149 -0
- package/dist/esm/variants/field-error.js +2 -0
- package/dist/esm/variants/field-error.js.map +7 -0
- package/dist/esm/variants/heading.d.ts +45 -0
- package/dist/esm/variants/index.d.ts +2 -0
- package/dist/esm/variants/index.js +1 -1
- package/dist/esm/variants/index.js.map +2 -2
- package/dist/esm/variants/link.d.ts +470 -0
- package/dist/esm/variants/link.js +2 -0
- package/dist/esm/variants/link.js.map +7 -0
- package/dist/esm/variants/popover.d.ts +4 -4
- package/dist/esm/variants/popover.js +1 -1
- package/dist/esm/variants/popover.js.map +2 -2
- package/dist/esm/variants/text-area.d.ts +298 -0
- package/dist/esm/variants/text-area.js +2 -0
- package/dist/esm/variants/text-area.js.map +7 -0
- package/dist/esm/variants/text-field.d.ts +218 -13
- package/dist/esm/variants/text-field.js +1 -1
- package/dist/esm/variants/text-field.js.map +3 -3
- package/dist/esm/variants/text.d.ts +48 -1
- package/dist/esm/variants/text.js +1 -1
- package/dist/esm/variants/text.js.map +2 -2
- package/dist/esm/variants/tooltip.d.ts +1 -1
- package/dist/esm/variants/tooltip.js +1 -1
- package/dist/esm/variants/tooltip.js.map +2 -2
- package/dist/esm/variants/typography.d.ts +35 -0
- package/dist/esm/variants/typography.js +1 -1
- package/dist/esm/variants/typography.js.map +2 -2
- package/package.json +5 -6
- package/src/components/button.tsx +17 -21
- package/src/components/card.tsx +2 -2
- package/src/components/checkbox.tsx +255 -0
- package/src/components/flex.tsx +17 -7
- package/src/components/form.tsx +30 -0
- package/src/components/index.ts +5 -0
- package/src/components/link.tsx +90 -0
- package/src/components/number-field.tsx +174 -0
- package/src/components/text-area.tsx +107 -0
- package/src/components/text-field.tsx +103 -3
- package/src/components/text.tsx +13 -4
- package/src/components/theme.tsx +16 -4
- package/src/components/tooltip.tsx +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-in-app.ts +17 -58
- package/src/hooks/use-product-release.ts +38 -0
- package/src/providers/DashXProvider.tsx +91 -5
- package/src/providers/index.ts +1 -1
- package/src/styles/index.css +180 -43
- package/src/utils/helpers.ts +21 -0
- package/src/variants/base-element.ts +18 -5
- package/src/variants/base-field.ts +42 -0
- package/src/variants/base-input.ts +13 -0
- package/src/variants/button.ts +47 -27
- package/src/variants/card.ts +3 -3
- package/src/variants/checkbox.ts +33 -0
- package/src/variants/field-error.ts +29 -0
- package/src/variants/index.ts +2 -0
- package/src/variants/link.ts +34 -0
- package/src/variants/popover.ts +5 -5
- package/src/variants/text-area.ts +26 -0
- package/src/variants/text-field.ts +14 -3
- package/src/variants/text.ts +2 -1
- package/src/variants/tooltip.ts +1 -1
- package/src/variants/typography.ts +14 -9
- package/styles.css +546 -124
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type SlotProps } from 'react-aria-components';
|
|
2
3
|
import type { AriaButtonProps, HoverEvents } from 'react-aria';
|
|
3
4
|
import type { ButtonVariantProps } from '../variants/button.js';
|
|
4
|
-
export interface ButtonProps extends Omit<AriaButtonProps, 'elementType' | 'href' | 'target' | 'rel'>, HoverEvents, ButtonVariantProps {
|
|
5
|
+
export interface ButtonProps extends Omit<AriaButtonProps, 'elementType' | 'href' | 'target' | 'rel'>, SlotProps, HoverEvents, ButtonVariantProps {
|
|
5
6
|
asChild?: boolean;
|
|
6
7
|
}
|
|
7
8
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},G=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _(t))!j.call(e,r)&&r!==n&&l(e,r,{get:()=>t[r],enumerable:!(s=N(t,r))||s.enumerable});return e};var I=e=>G(l({},"__esModule",{value:!0}),e);var K={};q(K,{Button:()=>b});module.exports=I(K);var B=require("react/jsx-runtime"),i=require("react"),d=require("react-aria-components"),u=require("@react-aria/utils"),o=require("react-aria"),c=require("@radix-ui/react-slot"),v=require("../variants/button.js"),p=require("../utils/cn.js"),a=require("../utils/helpers.js");function J(e,t){[e,t]=(0,d.useContextProps)(e,t,d.ButtonContext);const{asChild:n,children:s,size:r,mode:E,variant:H,roundness:m,elevation:f,shape:y,inset:C}=e;let h=n&&(0,i.isValidElement)(s)&&s?.type||"button";const[R,S]=(0,a.fallbackEventTo)(e,"onPress","onClick"),[T,w]=(0,a.fallbackEventTo)(e,"onPressStart","onPointerDown"),[x,M]=(0,a.fallbackEventTo)(e,"onHoverStart","onPointerMove"),[g,D]=(0,a.fallbackEventTo)(e,"onHoverEnd","onPointerLeave"),P=(0,i.useRef)(null);let{buttonProps:F,isPressed:L}=(0,o.useButton)({...e,elementType:h,onPress:R,onPressStart:T,onClick:S,onPointerDown:w,onPointerMove:M,onPointerLeave:D},P),{focusProps:V,isFocused:k,isFocusVisible:A}=(0,o.useFocusRing)(e),{hoverProps:O,isHovered:z}=(0,o.useHover)({...e,onHoverStart:x,onHoverEnd:g});return(0,B.jsx)(n?c.Slot:"button",{...(0,u.filterDOMProps)(e),...(0,o.mergeProps)(F,V,O),slot:e.slot||void 0,ref:(0,u.mergeRefs)(t,P),"data-disabled":e.isDisabled||void 0,"data-pressed":L||void 0,"data-hovered":z||void 0,"data-focused":k||void 0,"data-focus-visible":A||void 0,className:(0,p.cn)("dx",(0,v.button)({size:r,mode:E,variant:H,roundness:m,elevation:f,shape:y})),"data-radius":m,"data-shadow":f,"data-inset":C,children:s})}const b=(0,i.forwardRef)(J);
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/button.tsx"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["button_exports", "__export", "Button", "__toCommonJS", "import_jsx_runtime", "
|
|
4
|
+
"sourcesContent": ["import React, { forwardRef, isValidElement, useRef } from 'react';\nimport { ButtonContext, useContextProps, type SlotProps } from 'react-aria-components';\nimport { filterDOMProps, mergeRefs } from '@react-aria/utils';\nimport { mergeProps, useButton, useFocusRing, useHover } from 'react-aria';\nimport { Slot } from '@radix-ui/react-slot';\nimport type { ElementType } from 'react';\nimport type { AriaButtonProps, HoverEvents } from 'react-aria';\n\nimport { button } from '../variants/button.js';\nimport { cn } from '../utils/cn.js';\nimport { fallbackEventTo } from '../utils/helpers.js';\nimport type { ButtonVariantProps } from '../variants/button.js';\n\nexport interface ButtonProps\n extends Omit<AriaButtonProps, 'elementType' | 'href' | 'target' | 'rel'>,\n SlotProps,\n HoverEvents,\n ButtonVariantProps {\n asChild?: boolean;\n}\n\nfunction _Button(props: ButtonProps, ref: React.ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n const { asChild, children, size, mode, variant, roundness, elevation, shape, inset } = props;\n let elementType = asChild\n ? (isValidElement(children) && (children?.type as ElementType)) || 'button'\n : 'button';\n\n const [onPress, onClick] = fallbackEventTo(props, 'onPress', 'onClick');\n const [onPressStart, onPointerDown] = fallbackEventTo(props, 'onPressStart', 'onPointerDown');\n const [onHoverStart, onPointerMove] = fallbackEventTo(props, 'onHoverStart', 'onPointerMove');\n const [onHoverEnd, onPointerLeave] = fallbackEventTo(props, 'onHoverEnd', 'onPointerLeave');\n const innerRef = useRef<HTMLButtonElement>(null);\n let { buttonProps, isPressed } = useButton(\n {\n ...props,\n elementType,\n onPress,\n onPressStart,\n // @ts-ignore\n onClick,\n // @ts-ignore\n onPointerDown,\n // @ts-ignore\n onPointerMove,\n // @ts-ignore\n onPointerLeave,\n },\n innerRef,\n );\n let { focusProps, isFocused, isFocusVisible } = useFocusRing(props);\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n onHoverStart,\n onHoverEnd,\n });\n\n let Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n {...filterDOMProps(props)}\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n slot={props.slot || undefined}\n ref={mergeRefs(ref, innerRef)}\n data-disabled={props.isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n className={cn('dx', button({ size, mode, variant, roundness, elevation, shape }))}\n data-radius={roundness}\n data-shadow={elevation}\n data-inset={inset}\n >\n {children}\n </Comp>\n );\n}\n\nconst Button = forwardRef(_Button);\n\nexport { Button };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GA6DI,IAAAI,EAAA,6BA7DJC,EAA0D,iBAC1DC,EAA+D,iCAC/DC,EAA0C,6BAC1CC,EAA8D,sBAC9DC,EAAqB,gCAIrBC,EAAuB,iCACvBC,EAAmB,0BACnBC,EAAgC,+BAWhC,SAASC,EAAQC,EAAoBC,EAA4C,CAC/E,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,eAAa,EACxD,KAAM,CAAE,QAAAC,EAAS,SAAAC,EAAU,KA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EAEX,SAAAP,EACH,CAEJ,CAEA,MAAMf,KAAS,cAAWW,CAAO",
|
|
6
|
+
"names": ["button_exports", "__export", "Button", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_aria_components", "import_utils", "import_react_aria", "import_react_slot", "import_button", "import_cn", "import_helpers", "_Button", "props", "ref", "asChild", "children", "size", "mode", "variant", "roundness", "elevation", "shape", "inset", "elementType", "onPress", "onClick", "onPressStart", "onPointerDown", "onHoverStart", "onPointerMove", "onHoverEnd", "onPointerLeave", "innerRef", "buttonProps", "isPressed", "focusProps", "isFocused", "isFocusVisible", "hoverProps", "isHovered"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var f=Object.create;var
|
|
1
|
+
"use strict";var f=Object.create;var s=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var N=(r,a)=>{for(var o in a)s(r,o,{get:a[o],enumerable:!0})},p=(r,a,o,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of u(a))!y.call(r,t)&&t!==o&&s(r,t,{get:()=>a[t],enumerable:!(e=P(a,t))||e.enumerable});return r};var x=(r,a,o)=>(o=r!=null?f(v(r)):{},p(a||!r||!r.__esModule?s(o,"default",{value:r,enumerable:!0}):o,r)),H=r=>p(s({},"__esModule",{value:!0}),r);var M={};N(M,{Card:()=>i});module.exports=H(M);var c=require("react/jsx-runtime"),L=x(require("react")),n=require("@radix-ui/react-slot"),d=require("../variants/card.js"),C=require("../utils/cn.js");const i=L.forwardRef((r,a)=>{const{asChild:o,className:e,spacing:t="medium",roundness:m="medium",...l}=r;return(0,c.jsx)(o?n.Slot:"div",{ref:a,...l,className:(0,C.cn)("dx",(0,d.card)({className:e,spacing:t,roundness:m})),"data-radius":m,style:{"--padding":d.SPACING[t]}})});i.displayName="Card";
|
|
2
2
|
//# sourceMappingURL=card.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/card.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { SPACING, card } from '../variants/card.js';\nimport { cn } from '../utils/cn.js';\n\nimport type { CardVariantProps } from '../variants/card.js';\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement>, CardVariantProps {\n asChild?: boolean;\n}\nconst Card = React.forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { asChild, className, spacing = 'medium', roundness, ...rest } = props;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n ref={ref}\n {...rest}\n className={cn('
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAeI,IAAAI,EAAA,6BAfJC,EAAuB,oBACvBC,EAAqB,gCAErBC,EAA8B,+BAC9BC,EAAmB,0BAOnB,MAAMN,EAAOG,EAAM,WAAsC,CAACI,EAAOC,IAAQ,CACvE,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,QAAAC,EAAU,SAAU,UAAAC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { SPACING, card } from '../variants/card.js';\nimport { cn } from '../utils/cn.js';\n\nimport type { CardVariantProps } from '../variants/card.js';\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement>, CardVariantProps {\n asChild?: boolean;\n}\nconst Card = React.forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { asChild, className, spacing = 'medium', roundness = 'medium', ...rest } = props;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n ref={ref}\n {...rest}\n className={cn('dx', card({ className, spacing, roundness }))}\n data-radius={roundness}\n style={{\n // @ts-ignore\n '--padding': SPACING[spacing],\n }}\n />\n );\n});\n\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAeI,IAAAI,EAAA,6BAfJC,EAAuB,oBACvBC,EAAqB,gCAErBC,EAA8B,+BAC9BC,EAAmB,0BAOnB,MAAMN,EAAOG,EAAM,WAAsC,CAACI,EAAOC,IAAQ,CACvE,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,QAAAC,EAAU,SAAU,UAAAC,EAAY,SAAU,GAAGC,CAAK,EAAIN,EAElF,SACE,OAFWE,EAAU,OAAO,MAE3B,CACC,IAAKD,EACJ,GAAGK,EACJ,aAAW,MAAG,QAAM,QAAK,CAAE,UAAAH,EAAW,QAAAC,EAAS,UAAAC,CAAU,CAAC,CAAC,EAC3D,cAAaA,EACb,MAAO,CAEL,YAAa,UAAQD,CAAO,CAC9B,EACF,CAEJ,CAAC,EAEDX,EAAK,YAAc",
|
|
6
6
|
"names": ["card_exports", "__export", "Card", "__toCommonJS", "import_jsx_runtime", "React", "import_react_slot", "import_card", "import_cn", "props", "ref", "asChild", "className", "spacing", "roundness", "rest"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type SlotProps, type ValidationResult } from 'react-aria-components';
|
|
2
|
+
import { type AriaCheckboxGroupProps, type AriaCheckboxProps, type HoverEvents } from 'react-aria';
|
|
3
|
+
import { type MutableRefObject, type ReactNode } from 'react';
|
|
4
|
+
import { type CheckboxVariantProps } from '../variants/index.js';
|
|
5
|
+
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'validationState'>, CheckboxVariantProps, SlotProps {
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
description?: string | ReactNode;
|
|
9
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface CheckboxProps extends Omit<AriaCheckboxProps, 'validationState'>, HoverEvents, SlotProps, CheckboxVariantProps {
|
|
13
|
+
inputRef?: MutableRefObject<HTMLInputElement>;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
17
|
+
declare const CheckboxGroup: import("react").ForwardRefExoticComponent<CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export { Checkbox, CheckboxGroup };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var j=(e,i)=>{for(var o in i)y(e,o,{get:i[o],enumerable:!0})},A=(e,i,o,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of L(i))!N.call(e,r)&&r!==o&&y(e,r,{get:()=>i[r],enumerable:!(t=D(i,r))||t.enumerable});return e};var z=e=>A(y({},"__esModule",{value:!0}),e);var K={};j(K,{Checkbox:()=>V,CheckboxGroup:()=>B});module.exports=z(K);var d=require("react/jsx-runtime"),a=require("react-aria-components"),n=require("react-aria"),m=require("react-stately"),s=require("@react-aria/utils"),c=require("react"),u=require("./text.js"),h=require("./flex.js"),F=require("../variants/field-error.js"),R=require("../utils/cn.js"),T=require("../variants/index.js");function _(e,i){[e,i]=(0,a.useContextProps)(e,i,a.CheckboxGroupContext);let{validationBehavior:o}=(0,a.useSlottedContext)(a.FormContext)||{},t=e.validationBehavior??o??"native",r=(0,m.useCheckboxGroupState)({...e,validationBehavior:t}),{groupProps:v,labelProps:x,descriptionProps:b,errorMessageProps:C,...l}=(0,n.useCheckboxGroup)({...e,validationBehavior:t},r);return(0,d.jsxs)(h.Flex,{...v,direction:"column",gap:2,ref:i,slot:e.slot||void 0,"data-readonly":r.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":r.isInvalid||void 0,"data-disabled":e.isDisabled||void 0,children:[e.label&&(0,d.jsx)(u.Text,{...x,size:1,transform:"uppercase",weight:"semibold",variant:"tertiary",color:"gray",children:e.label}),(0,d.jsx)(a.CheckboxGroupStateContext.Provider,{value:r,children:e.children}),l.isInvalid&&(0,d.jsx)(u.Text,{...C,size:1,className:(0,R.cn)("dx",(0,F.fieldError)({})),children:e.errorMessage?typeof e.errorMessage=="string"?e.errorMessage:e.errorMessage(l):l.validationErrors.length===0?void 0:l.validationErrors.join(" ")}),e.description&&(0,d.jsx)(u.Text,{size:1,variant:"tertiary",...b,children:e.description})]})}function J({size:e="medium",roundness:i="medium",elevation:o="medium",...t},r){let{inputRef:v=null,...x}=t;[t,r]=(0,a.useContextProps)(x,r,a.CheckboxContext);let{validationBehavior:b}=(0,a.useSlottedContext)(a.FormContext)||{},C=t.validationBehavior??b??"native",l=(0,c.useContext)(a.CheckboxGroupStateContext),g=(0,s.useObjectRef)((0,s.mergeRefs)(v,t.inputRef!==void 0?t.inputRef:null)),{labelProps:H,inputProps:I,isSelected:f,isDisabled:k,isReadOnly:P,isPressed:p,isInvalid:M}=l?(0,n.useCheckboxGroupItem)({...t,value:t.value,children:typeof t.children=="function"?!0:t.children},l,g):(0,n.useCheckbox)({...t,children:typeof t.children=="function"?!0:t.children,validationBehavior:C},(0,m.useToggleState)(t),g),{isFocused:w,isFocusVisible:G,focusProps:q}=(0,n.useFocusRing)(),E=k||P,{hoverProps:O,isHovered:S}=(0,n.useHover)({...t,isDisabled:E});return(0,d.jsx)(h.Flex,{asChild:!0,gap:2,children:(0,d.jsxs)(u.Text,{as:"label",...(0,n.mergeProps)((0,s.filterDOMProps)(t),H,O),color:"gray",variant:f?"primary":"secondary",ref:r,slot:t.slot||void 0,"data-selected":f||void 0,"data-indeterminate":t.isIndeterminate||void 0,"data-pressed":p||void 0,"data-hovered":S||void 0,"data-focused":w||void 0,"data-focus-visible":G||void 0,"data-disabled":k||void 0,"data-readonly":P||void 0,"data-invalid":M||void 0,"data-required":t.isRequired||void 0,size:{small:1,medium:2,large:3}[e],children:[(0,d.jsx)(n.VisuallyHidden,{elementType:"span",children:(0,d.jsx)("input",{...(0,n.mergeProps)(I,q),ref:g})}),(0,d.jsx)(h.Flex,{"data-radius":i,"data-elevation":o,"data-selected":f||void 0,"data-indeterminate":t.isIndeterminate||void 0,"data-pressed":p||void 0,"data-hovered":S||void 0,"data-focused":w||void 0,"data-focus-visible":G||void 0,"data-disabled":k||void 0,"data-readonly":P||void 0,"data-invalid":M||void 0,"data-required":t.isRequired||void 0,justify:"center",align:"center",className:(0,R.cn)("dx",(0,T.checkbox)({size:e,roundness:i})),children:f?(0,d.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 11 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,d.jsx)("path",{d:"M4.43968 6.18236L2.31836 4.06104",stroke:"currentColor","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square"}),(0,d.jsx)("path",{d:"M5.85419 4.76739L8.68262 1.93896",stroke:"currentColor","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"square"})]}):null}),t.children]})})}const V=(0,c.forwardRef)(J),B=(0,c.forwardRef)(_);
|
|
2
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/checkbox.tsx"],
|
|
4
|
+
"sourcesContent": ["import {\n CheckboxContext,\n CheckboxGroupContext,\n CheckboxGroupStateContext,\n FormContext,\n useContextProps,\n useSlottedContext,\n type SlotProps,\n type ValidationResult,\n} from 'react-aria-components';\nimport {\n type AriaCheckboxGroupProps,\n type AriaCheckboxProps,\n type HoverEvents,\n mergeProps,\n useCheckbox,\n useCheckboxGroup,\n useCheckboxGroupItem,\n useFocusRing,\n useHover,\n VisuallyHidden,\n} from 'react-aria';\nimport { useCheckboxGroupState, useToggleState } from 'react-stately';\nimport { filterDOMProps, mergeRefs, useObjectRef } from '@react-aria/utils';\nimport {\n forwardRef,\n useContext,\n type ForwardedRef,\n type MutableRefObject,\n type ReactNode,\n} from 'react';\n\nimport { Text } from './text.js';\nimport { Flex } from './flex.js';\nimport { fieldError } from '../variants/field-error.js';\nimport { cn } from '../utils/cn.js';\nimport { checkbox, type CheckboxVariantProps } from '../variants/index.js';\n\nexport interface CheckboxGroupProps\n extends Omit<AriaCheckboxGroupProps, 'validationState'>,\n CheckboxVariantProps,\n SlotProps {\n placeholder?: string;\n label?: string;\n description?: string | ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n children?: ReactNode;\n}\nexport interface CheckboxProps\n extends Omit<AriaCheckboxProps, 'validationState'>,\n HoverEvents,\n SlotProps,\n CheckboxVariantProps {\n inputRef?: MutableRefObject<HTMLInputElement>;\n children?: ReactNode;\n}\n\nfunction _CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n let { validationBehavior: formValidationBehavior } = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useCheckboxGroupState({\n ...props,\n validationBehavior,\n });\n\n let { groupProps, labelProps, descriptionProps, errorMessageProps, ...validation } =\n useCheckboxGroup(\n {\n ...props,\n validationBehavior,\n },\n state,\n );\n\n return (\n <Flex\n {...groupProps}\n direction=\"column\"\n gap={2}\n ref={ref}\n slot={props.slot || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={props.isDisabled || undefined}\n >\n {props.label && (\n <Text\n {...labelProps}\n size={1}\n transform=\"uppercase\"\n weight=\"semibold\"\n variant=\"tertiary\"\n color=\"gray\"\n >\n {props.label}\n </Text>\n )}\n <CheckboxGroupStateContext.Provider value={state}>\n {props.children}\n </CheckboxGroupStateContext.Provider>\n {validation.isInvalid && (\n <Text {...errorMessageProps} size={1} className={cn('dx', fieldError({}))}>\n {props.errorMessage\n ? typeof props.errorMessage === 'string'\n ? props.errorMessage\n : props.errorMessage(validation)\n : validation.validationErrors.length === 0\n ? undefined\n : validation.validationErrors.join(' ')}\n </Text>\n )}\n\n {props.description && (\n <Text size={1} variant=\"tertiary\" {...descriptionProps}>\n {props.description}\n </Text>\n )}\n </Flex>\n );\n}\n\nfunction _Checkbox(\n { size = 'medium', roundness = 'medium', elevation = 'medium', ...props }: CheckboxProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n let { inputRef: userProvidedInputRef = null, ...otherProps } = props;\n [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n let { validationBehavior: formValidationBehavior } = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let groupState = useContext(CheckboxGroupStateContext);\n let inputRef = useObjectRef(\n mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n );\n let { labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid } =\n groupState\n ? // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckboxGroupItem(\n {\n ...props,\n // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n // it's passed explicitly here to avoid typescript error (requires ignore).\n // @ts-ignore\n value: props.value,\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children,\n },\n groupState,\n inputRef,\n )\n : // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckbox(\n {\n ...props,\n children: typeof props.children === 'function' ? true : props.children,\n validationBehavior,\n // eslint-disable-next-line react-hooks/rules-of-hooks\n },\n useToggleState(props),\n inputRef,\n );\n let { isFocused, isFocusVisible, focusProps } = useFocusRing();\n let isInteractionDisabled = isDisabled || isReadOnly;\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n isDisabled: isInteractionDisabled,\n });\n\n return (\n <Flex asChild gap={2}>\n <Text\n as=\"label\"\n {...mergeProps(filterDOMProps(props), labelProps, hoverProps)}\n color=\"gray\"\n variant={isSelected ? 'primary' : 'secondary'}\n ref={ref}\n slot={props.slot || undefined}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}\n size={\n (\n {\n small: 1,\n medium: 2,\n large: 3,\n } as const\n )[size]\n }\n >\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n <Flex\n data-radius={roundness}\n data-elevation={elevation}\n data-selected={isSelected || undefined}\n data-indeterminate={props.isIndeterminate || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-required={props.isRequired || undefined}\n justify=\"center\"\n align=\"center\"\n className={cn('dx', checkbox({ size, roundness }))}\n >\n {isSelected ? (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 11 8\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4.43968 6.18236L2.31836 4.06104\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-miterlimit=\"10\"\n stroke-linecap=\"square\"\n />\n <path\n d=\"M5.85419 4.76739L8.68262 1.93896\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-miterlimit=\"10\"\n stroke-linecap=\"square\"\n />\n </svg>\n ) : null}\n </Flex>\n {props.children}\n </Text>\n </Flex>\n );\n}\n\nconst Checkbox = forwardRef(_Checkbox);\n\nconst CheckboxGroup = forwardRef(_CheckboxGroup);\n\nexport { Checkbox, CheckboxGroup };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA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_exports", "__export", "Checkbox", "CheckboxGroup", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_react_aria", "import_react_stately", "import_utils", "import_react", "import_text", "import_flex", "import_field_error", "import_cn", "import_variants", "_CheckboxGroup", "props", "ref", "formValidationBehavior", "validationBehavior", "state", "groupProps", "labelProps", "descriptionProps", "errorMessageProps", "validation", "_Checkbox", "size", "roundness", "elevation", "userProvidedInputRef", "otherProps", "groupState", "inputRef", "inputProps", "isSelected", "isDisabled", "isReadOnly", "isPressed", "isInvalid", "isFocused", "isFocusVisible", "focusProps", "isInteractionDisabled", "hoverProps", "isHovered"]
|
|
7
|
+
}
|
|
@@ -2,8 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { VariantProps } from 'tailwind-variants';
|
|
3
3
|
declare const flexVariants: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
direction: {
|
|
5
|
-
column: string
|
|
6
|
-
row: string
|
|
5
|
+
column: string;
|
|
6
|
+
row: string;
|
|
7
|
+
'column-reverse': string;
|
|
8
|
+
'row-reverse': string;
|
|
7
9
|
};
|
|
8
10
|
gap: {
|
|
9
11
|
1: string;
|
|
@@ -22,46 +24,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
|
|
|
22
24
|
32: string;
|
|
23
25
|
};
|
|
24
26
|
justify: {
|
|
25
|
-
center: string;
|
|
26
|
-
between: string;
|
|
27
|
-
};
|
|
28
|
-
align: {
|
|
29
27
|
baseline: string;
|
|
30
28
|
center: string;
|
|
31
|
-
};
|
|
32
|
-
}, undefined, "flex", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
33
|
-
direction: {
|
|
34
|
-
column: string[];
|
|
35
|
-
row: string[];
|
|
36
|
-
};
|
|
37
|
-
gap: {
|
|
38
|
-
1: string;
|
|
39
|
-
2: string;
|
|
40
|
-
3: string;
|
|
41
|
-
4: string;
|
|
42
|
-
6: string;
|
|
43
|
-
8: string;
|
|
44
|
-
10: string;
|
|
45
|
-
12: string;
|
|
46
|
-
14: string;
|
|
47
|
-
16: string;
|
|
48
|
-
18: string;
|
|
49
|
-
24: string;
|
|
50
|
-
28: string;
|
|
51
|
-
32: string;
|
|
52
|
-
};
|
|
53
|
-
justify: {
|
|
54
|
-
center: string;
|
|
55
29
|
between: string;
|
|
30
|
+
start: string;
|
|
31
|
+
end: string;
|
|
56
32
|
};
|
|
57
33
|
align: {
|
|
58
34
|
baseline: string;
|
|
59
35
|
center: string;
|
|
36
|
+
start: string;
|
|
37
|
+
end: string;
|
|
60
38
|
};
|
|
61
|
-
}, {
|
|
39
|
+
}, undefined, "flex", {
|
|
62
40
|
direction: {
|
|
63
|
-
column: string
|
|
64
|
-
row: string
|
|
41
|
+
column: string;
|
|
42
|
+
row: string;
|
|
43
|
+
'column-reverse': string;
|
|
44
|
+
'row-reverse': string;
|
|
65
45
|
};
|
|
66
46
|
gap: {
|
|
67
47
|
1: string;
|
|
@@ -80,17 +60,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
|
|
|
80
60
|
32: string;
|
|
81
61
|
};
|
|
82
62
|
justify: {
|
|
63
|
+
baseline: string;
|
|
83
64
|
center: string;
|
|
84
65
|
between: string;
|
|
66
|
+
start: string;
|
|
67
|
+
end: string;
|
|
85
68
|
};
|
|
86
69
|
align: {
|
|
87
70
|
baseline: string;
|
|
88
71
|
center: string;
|
|
72
|
+
start: string;
|
|
73
|
+
end: string;
|
|
89
74
|
};
|
|
90
|
-
}
|
|
75
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
91
76
|
direction: {
|
|
92
|
-
column: string
|
|
93
|
-
row: string
|
|
77
|
+
column: string;
|
|
78
|
+
row: string;
|
|
79
|
+
'column-reverse': string;
|
|
80
|
+
'row-reverse': string;
|
|
94
81
|
};
|
|
95
82
|
gap: {
|
|
96
83
|
1: string;
|
|
@@ -109,17 +96,28 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
|
|
|
109
96
|
32: string;
|
|
110
97
|
};
|
|
111
98
|
justify: {
|
|
99
|
+
baseline: string;
|
|
112
100
|
center: string;
|
|
113
101
|
between: string;
|
|
102
|
+
start: string;
|
|
103
|
+
end: string;
|
|
114
104
|
};
|
|
115
105
|
align: {
|
|
116
106
|
baseline: string;
|
|
117
107
|
center: string;
|
|
118
|
-
|
|
119
|
-
|
|
108
|
+
start: string;
|
|
109
|
+
end: string;
|
|
110
|
+
};
|
|
111
|
+
}, undefined, "flex", unknown, unknown, undefined>>;
|
|
112
|
+
type FlexProps = VariantProps<typeof flexVariants> & {
|
|
113
|
+
asChild?: boolean;
|
|
114
|
+
};
|
|
115
|
+
declare const Flex: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<import("tailwind-variants").TVReturnType<{
|
|
120
116
|
direction: {
|
|
121
|
-
column: string
|
|
122
|
-
row: string
|
|
117
|
+
column: string;
|
|
118
|
+
row: string;
|
|
119
|
+
'column-reverse': string;
|
|
120
|
+
'row-reverse': string;
|
|
123
121
|
};
|
|
124
122
|
gap: {
|
|
125
123
|
1: string;
|
|
@@ -138,17 +136,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
|
|
|
138
136
|
32: string;
|
|
139
137
|
};
|
|
140
138
|
justify: {
|
|
139
|
+
baseline: string;
|
|
141
140
|
center: string;
|
|
142
141
|
between: string;
|
|
142
|
+
start: string;
|
|
143
|
+
end: string;
|
|
143
144
|
};
|
|
144
145
|
align: {
|
|
145
146
|
baseline: string;
|
|
146
147
|
center: string;
|
|
148
|
+
start: string;
|
|
149
|
+
end: string;
|
|
147
150
|
};
|
|
148
|
-
}, undefined, "flex",
|
|
151
|
+
}, undefined, "flex", {
|
|
149
152
|
direction: {
|
|
150
|
-
column: string
|
|
151
|
-
row: string
|
|
153
|
+
column: string;
|
|
154
|
+
row: string;
|
|
155
|
+
'column-reverse': string;
|
|
156
|
+
'row-reverse': string;
|
|
152
157
|
};
|
|
153
158
|
gap: {
|
|
154
159
|
1: string;
|
|
@@ -167,17 +172,24 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
|
|
|
167
172
|
32: string;
|
|
168
173
|
};
|
|
169
174
|
justify: {
|
|
175
|
+
baseline: string;
|
|
170
176
|
center: string;
|
|
171
177
|
between: string;
|
|
178
|
+
start: string;
|
|
179
|
+
end: string;
|
|
172
180
|
};
|
|
173
181
|
align: {
|
|
174
182
|
baseline: string;
|
|
175
183
|
center: string;
|
|
184
|
+
start: string;
|
|
185
|
+
end: string;
|
|
176
186
|
};
|
|
177
|
-
}, {
|
|
187
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
178
188
|
direction: {
|
|
179
|
-
column: string
|
|
180
|
-
row: string
|
|
189
|
+
column: string;
|
|
190
|
+
row: string;
|
|
191
|
+
'column-reverse': string;
|
|
192
|
+
'row-reverse': string;
|
|
181
193
|
};
|
|
182
194
|
gap: {
|
|
183
195
|
1: string;
|
|
@@ -196,15 +208,20 @@ declare const flexVariants: import("tailwind-variants").TVReturnType<{
|
|
|
196
208
|
32: string;
|
|
197
209
|
};
|
|
198
210
|
justify: {
|
|
211
|
+
baseline: string;
|
|
199
212
|
center: string;
|
|
200
213
|
between: string;
|
|
214
|
+
start: string;
|
|
215
|
+
end: string;
|
|
201
216
|
};
|
|
202
217
|
align: {
|
|
203
218
|
baseline: string;
|
|
204
219
|
center: string;
|
|
220
|
+
start: string;
|
|
221
|
+
end: string;
|
|
205
222
|
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
223
|
+
}, undefined, "flex", unknown, unknown, undefined>>> & {
|
|
224
|
+
asChild?: boolean;
|
|
225
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
209
226
|
export type { FlexProps };
|
|
210
227
|
export { Flex };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var y=Object.create;var i=Object.defineProperty;var
|
|
1
|
+
"use strict";var y=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var a in t)i(e,a,{get:t[a],enumerable:!0})},n=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!w.call(e,r)&&r!==a&&i(e,r,{get:()=>t[r],enumerable:!(s=u(t,r))||s.enumerable});return e};var F=(e,t,a)=>(a=e!=null?y(b(e)):{},n(t||!e||!e.__esModule?i(a,"default",{value:e,enumerable:!0}):a,e)),P=e=>n(i({},"__esModule",{value:!0}),e);var V={};j(V,{Flex:()=>o});module.exports=P(V);var m=require("react/jsx-runtime"),p=F(require("react")),l=require("tailwind-variants"),f=require("@radix-ui/react-slot"),M=require("../utils/cn.js");const C=(0,l.tv)({base:"flex",variants:{direction:{column:"flex-col",row:"flex-row","column-reverse":"flex-col-reverse","row-reverse":"flex-row-reverse"},gap:{1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8",10:"gap-10",12:"gap-12",14:"gap-14",16:"gap-16",18:"gap-18",24:"gap-24",28:"gap-28",32:"gap-32"},justify:{baseline:"justify-baseline",center:"justify-center",between:"justify-between",start:"justify-start",end:"justify-end"},align:{baseline:"items-baseline",center:"items-center",start:"items-start",end:"items-end"}}}),o=p.default.forwardRef((e,t)=>{const{className:a,direction:s,gap:r,justify:c,align:g,asChild:x,...d}=e;return(0,m.jsx)(x?f.Slot:"div",{className:C({direction:s,gap:r,justify:c,align:g,className:a}),ref:t,...d})});o.displayName="Flex";
|
|
2
2
|
//# sourceMappingURL=flex.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/flex.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { tv } from 'tailwind-variants';\n\nimport { cn } from '../utils/cn.js';\n\nimport type { VariantProps } from 'tailwind-variants';\n\nconst flexVariants = tv({\n base: 'flex',\n variants: {\n direction: {\n column:
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["flex_exports", "__export", "Flex", "__toCommonJS", "import_jsx_runtime", "import_react", "import_tailwind_variants", "import_cn", "flexVariants", "React", "props", "ref", "className", "direction", "gap", "justify", "align", "rest"]
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { tv } from 'tailwind-variants';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../utils/cn.js';\n\nimport type { VariantProps } from 'tailwind-variants';\n\nconst flexVariants = tv({\n base: 'flex',\n variants: {\n direction: {\n column: 'flex-col',\n row: 'flex-row',\n 'column-reverse': 'flex-col-reverse',\n 'row-reverse': 'flex-row-reverse',\n },\n gap: {\n 1: 'gap-1',\n 2: 'gap-2',\n 3: 'gap-3',\n 4: 'gap-4',\n 6: 'gap-6',\n 8: 'gap-8',\n 10: 'gap-10',\n 12: 'gap-12',\n 14: 'gap-14',\n 16: 'gap-16',\n 18: 'gap-18',\n 24: 'gap-24',\n 28: 'gap-28',\n 32: 'gap-32',\n },\n justify: {\n baseline: 'justify-baseline',\n center: 'justify-center',\n between: 'justify-between',\n start: 'justify-start',\n end: 'justify-end',\n },\n align: {\n baseline: 'items-baseline',\n center: 'items-center',\n start: 'items-start',\n end: 'items-end',\n },\n },\n});\n\ntype FlexProps = VariantProps<typeof flexVariants> & {\n asChild?: boolean;\n};\n\nconst Flex = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & FlexProps>(\n (props, ref) => {\n const { className, direction, gap, justify, align, asChild, ...rest } = props;\n const Comp = asChild ? Slot : 'div';\n return (\n <Comp\n className={flexVariants({ direction, gap, justify, align, className })}\n ref={ref}\n {...rest}\n />\n );\n },\n);\n\nFlex.displayName = 'Flex';\n\nexport type { FlexProps };\nexport { Flex };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GA0DM,IAAAI,EAAA,6BA1DNC,EAAkB,oBAClBC,EAAmB,6BACnBC,EAAqB,gCAErBC,EAAmB,0BAInB,MAAMC,KAAe,MAAG,CACtB,KAAM,OACN,SAAU,CACR,UAAW,CACT,OAAQ,WACR,IAAK,WACL,iBAAkB,mBAClB,cAAe,kBACjB,EACA,IAAK,CACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,QACN,EACA,QAAS,CACP,SAAU,mBACV,OAAQ,iBACR,QAAS,kBACT,MAAO,gBACP,IAAK,aACP,EACA,MAAO,CACL,SAAU,iBACV,OAAQ,eACR,MAAO,cACP,IAAK,WACP,CACF,CACF,CAAC,EAMKP,EAAO,EAAAQ,QAAM,WACjB,CAACC,EAAOC,IAAQ,CACd,KAAM,CAAE,UAAAC,EAAW,UAAAC,EAAW,IAAAC,EAAK,QAAAC,EAAS,MAAAC,EAAO,QAAAC,EAAS,GAAGC,CAAK,EAAIR,EAExE,SACE,OAFWO,EAAU,OAAO,MAE3B,CACC,UAAWT,EAAa,CAAE,UAAAK,EAAW,IAAAC,EAAK,QAAAC,EAAS,MAAAC,EAAO,UAAAJ,CAAU,CAAC,EACrE,IAAKD,EACJ,GAAGO,EACN,CAEJ,CACF,EAEAjB,EAAK,YAAc",
|
|
6
|
+
"names": ["flex_exports", "__export", "Flex", "__toCommonJS", "import_jsx_runtime", "import_react", "import_tailwind_variants", "import_react_slot", "import_cn", "flexVariants", "React", "props", "ref", "className", "direction", "gap", "justify", "align", "asChild", "rest"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormProps as _FormProps } from '@react-types/form';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import type { DOMProps } from '@react-types/shared';
|
|
4
|
+
export interface FormProps extends _FormProps, DOMProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
noValidate?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Form: import("react").ForwardRefExoticComponent<FormProps & import("react").RefAttributes<HTMLFormElement>>;
|
|
11
|
+
export { Form };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var c=(o,r)=>{for(var t in r)i(o,t,{get:r[t],enumerable:!0})},v=(o,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of F(r))!P.call(o,e)&&e!==t&&i(o,e,{get:()=>r[e],enumerable:!(a=f(r,e))||a.enumerable});return o};var x=o=>v(i({},"__esModule",{value:!0}),o);var C={};c(C,{Form:()=>p});module.exports=x(C);var m=require("react/jsx-runtime"),s=require("react-aria-components"),d=require("react-stately"),n=require("react");function y(o,r){let{validationErrors:t,children:a,className:e,...l}=o;return(0,m.jsx)("form",{...l,ref:r,className:e,children:(0,m.jsx)(s.FormContext.Provider,{value:{validationBehavior:o.noValidate?"aria":"native"},children:(0,m.jsx)(d.FormValidationContext.Provider,{value:t??{},children:a})})})}const p=(0,n.forwardRef)(y);
|
|
2
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/form.tsx"],
|
|
4
|
+
"sourcesContent": ["import { FormContext } from 'react-aria-components';\nimport { FormValidationContext } from 'react-stately';\nimport { forwardRef } from 'react';\n\nimport type { FormProps as _FormProps } from '@react-types/form';\nimport type { CSSProperties, ForwardedRef, ReactNode } from 'react';\nimport type { DOMProps } from '@react-types/shared';\n\nexport interface FormProps extends _FormProps, DOMProps {\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n noValidate?: boolean;\n}\n\nfunction _Form(props: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n let { validationErrors, children, className, ...domProps } = props;\n return (\n <form {...domProps} ref={ref} className={className}>\n <FormContext.Provider value={{ validationBehavior: props.noValidate ? 'aria' : 'native' }}>\n <FormValidationContext.Provider value={validationErrors ?? {}}>\n {children}\n </FormValidationContext.Provider>\n </FormContext.Provider>\n </form>\n );\n}\n\nconst Form = forwardRef(_Form);\nexport { Form };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAoBQ,IAAAI,EAAA,6BApBRC,EAA4B,iCAC5BC,EAAsC,yBACtCC,EAA2B,iBAa3B,SAASC,EAAMC,EAAkBC,EAAoC,CACnE,GAAI,CAAE,iBAAAC,EAAkB,SAAAC,EAAU,UAAAC,EAAW,GAAGC,CAAS,EAAIL,EAC7D,SACE,OAAC,QAAM,GAAGK,EAAU,IAAKJ,EAAK,UAAWG,EACvC,mBAAC,cAAY,SAAZ,CAAqB,MAAO,CAAE,mBAAoBJ,EAAM,WAAa,OAAS,QAAS,EACtF,mBAAC,wBAAsB,SAAtB,CAA+B,MAAOE,GAAoB,CAAC,EACzD,SAAAC,EACH,EACF,EACF,CAEJ,CAEA,MAAMV,KAAO,cAAWM,CAAK",
|
|
6
|
+
"names": ["form_exports", "__export", "Form", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_react_stately", "import_react", "_Form", "props", "ref", "validationErrors", "children", "className", "domProps"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export * from './button.js';
|
|
2
2
|
export * from './card.js';
|
|
3
|
+
export * from './checkbox.js';
|
|
3
4
|
export * from './flex.js';
|
|
5
|
+
export * from './form.js';
|
|
4
6
|
export * from './heading.js';
|
|
5
7
|
export * from './icon-button.js';
|
|
8
|
+
export * from './link.js';
|
|
9
|
+
export * from './number-field.js';
|
|
6
10
|
export * as Popover from './popover.js';
|
|
7
11
|
export * from './toast.js';
|
|
8
12
|
export * from './text.js';
|
|
13
|
+
export * from './text-area.js';
|
|
9
14
|
export * from './text-field.js';
|
|
10
15
|
export * from './theme.js';
|
|
11
16
|
export * as Tooltip from './tooltip.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var i=Object.create;var x=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(p,e)=>{for(var t in e)x(p,t,{get:e[t],enumerable:!0})},m=(p,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of v(e))!T.call(p,f)&&f!==t&&x(p,f,{get:()=>e[f],enumerable:!(a=l(e,f))||a.enumerable});return p},r=(p,e,t)=>(m(p,e,"default"),t&&m(t,e,"default")),s=(p,e,t)=>(t=p!=null?i(P(p)):{},m(e||!p||!p.__esModule?x(t,"default",{value:p,enumerable:!0}):t,p)),c=p=>m(x({},"__esModule",{value:!0}),p);var o={};b(o,{Popover:()=>d,Tooltip:()=>g});module.exports=c(o);r(o,require("./button.js"),module.exports);r(o,require("./card.js"),module.exports);r(o,require("./flex.js"),module.exports);r(o,require("./heading.js"),module.exports);r(o,require("./icon-button.js"),module.exports);var d=s(require("./popover.js"));r(o,require("./toast.js"),module.exports);r(o,require("./text.js"),module.exports);r(o,require("./text-field.js"),module.exports);r(o,require("./theme.js"),module.exports);var g=s(require("./tooltip.js"));
|
|
1
|
+
"use strict";var i=Object.create;var x=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(p,e)=>{for(var t in e)x(p,t,{get:e[t],enumerable:!0})},m=(p,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of v(e))!T.call(p,f)&&f!==t&&x(p,f,{get:()=>e[f],enumerable:!(a=l(e,f))||a.enumerable});return p},r=(p,e,t)=>(m(p,e,"default"),t&&m(t,e,"default")),s=(p,e,t)=>(t=p!=null?i(P(p)):{},m(e||!p||!p.__esModule?x(t,"default",{value:p,enumerable:!0}):t,p)),c=p=>m(x({},"__esModule",{value:!0}),p);var o={};b(o,{Popover:()=>d,Tooltip:()=>g});module.exports=c(o);r(o,require("./button.js"),module.exports);r(o,require("./card.js"),module.exports);r(o,require("./checkbox.js"),module.exports);r(o,require("./flex.js"),module.exports);r(o,require("./form.js"),module.exports);r(o,require("./heading.js"),module.exports);r(o,require("./icon-button.js"),module.exports);r(o,require("./link.js"),module.exports);r(o,require("./number-field.js"),module.exports);var d=s(require("./popover.js"));r(o,require("./toast.js"),module.exports);r(o,require("./text.js"),module.exports);r(o,require("./text-area.js"),module.exports);r(o,require("./text-field.js"),module.exports);r(o,require("./theme.js"),module.exports);var g=s(require("./tooltip.js"));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './button.js';\nexport * from './card.js';\nexport * from './flex.js';\nexport * from './heading.js';\nexport * from './icon-button.js';\nexport * as Popover from './popover.js';\nexport * from './toast.js';\nexport * from './text.js';\nexport * from './text-field.js';\nexport * from './theme.js';\nexport * as Tooltip from './tooltip.js';\n"],
|
|
5
|
-
"mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAAAK,EAAAL,EAAc,uBAAd,gBACAK,EAAAL,EAAc,qBADd,gBAEAK,EAAAL,EAAc,
|
|
4
|
+
"sourcesContent": ["export * from './button.js';\nexport * from './card.js';\nexport * from './checkbox.js';\nexport * from './flex.js';\nexport * from './form.js';\nexport * from './heading.js';\nexport * from './icon-button.js';\nexport * from './link.js';\nexport * from './number-field.js';\nexport * as Popover from './popover.js';\nexport * from './toast.js';\nexport * from './text.js';\nexport * from './text-area.js';\nexport * from './text-field.js';\nexport * from './theme.js';\nexport * as Tooltip from './tooltip.js';\n"],
|
|
5
|
+
"mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAAAK,EAAAL,EAAc,uBAAd,gBACAK,EAAAL,EAAc,qBADd,gBAEAK,EAAAL,EAAc,yBAFd,gBAGAK,EAAAL,EAAc,qBAHd,gBAIAK,EAAAL,EAAc,qBAJd,gBAKAK,EAAAL,EAAc,wBALd,gBAMAK,EAAAL,EAAc,4BANd,gBAOAK,EAAAL,EAAc,qBAPd,gBAQAK,EAAAL,EAAc,6BARd,gBASA,IAAAE,EAAyB,2BACzBG,EAAAL,EAAc,sBAVd,gBAWAK,EAAAL,EAAc,qBAXd,gBAYAK,EAAAL,EAAc,0BAZd,gBAaAK,EAAAL,EAAc,2BAbd,gBAcAK,EAAAL,EAAc,sBAdd,gBAeA,IAAAG,EAAyB",
|
|
6
6
|
"names": ["components_exports", "__export", "Popover", "Tooltip", "__toCommonJS", "__reExport"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SlotProps } from 'react-aria-components';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { AriaLinkOptions, HoverEvents } from 'react-aria';
|
|
4
|
+
import { type LinkVariantProps } from '../variants/index.js';
|
|
5
|
+
export interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, SlotProps, HoverEvents, LinkVariantProps {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
export { Link };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var G=(e,n)=>{for(var t in n)m(e,t,{get:n[t],enumerable:!0})},I=(e,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of q(n))!B.call(e,i)&&i!==t&&m(e,i,{get:()=>n[i],enumerable:!(a=_(n,i))||a.enumerable});return e};var J=e=>I(m({},"__esModule",{value:!0}),e);var Q={};G(Q,{Link:()=>v});module.exports=J(Q);var k=require("react/jsx-runtime"),r=require("react-aria-components"),d=require("@react-aria/utils"),l=require("react"),o=require("react-aria"),f=require("@radix-ui/react-slot"),u=require("react"),P=require("../variants/index.js"),s=require("../utils/helpers.js");function K(e,n){[e,n]=(0,r.useContextProps)(e,n,r.TextContext),[e,n]=(0,r.useContextProps)(e,n,r.LinkContext);const{asChild:t,children:a,size:i,align:L,color:y,variant:p,weight:C,transform:E,underline:H}=e;let h=t&&(0,l.isValidElement)(a)&&a?.type||"a";const[R,T]=(0,s.fallbackEventTo)(e,"onPress","onClick"),[S,b]=(0,s.fallbackEventTo)(e,"onPressStart","onPointerDown"),[g,w]=(0,s.fallbackEventTo)(e,"onHoverStart","onPointerMove"),[x,F]=(0,s.fallbackEventTo)(e,"onHoverEnd","onPointerLeave"),c=(0,u.useRef)(null);let{linkProps:M,isPressed:A}=(0,o.useLink)({...e,elementType:h,onPress:R,onPressStart:S,onClick:T,onPointerDown:b,onPointerMove:w,onPointerLeave:F},c),{focusProps:D,isFocused:O,isFocusVisible:V}=(0,o.useFocusRing)(e),{hoverProps:N,isHovered:z}=(0,o.useHover)({...e,onHoverStart:g,onHoverEnd:x});return(0,k.jsx)(t?f.Slot:"a",{...(0,d.filterDOMProps)(e),...(0,o.mergeProps)(M,D,N),slot:e.slot||void 0,ref:(0,d.mergeRefs)(n,c),"data-disabled":e.isDisabled||void 0,"data-pressed":A||void 0,"data-hovered":z||void 0,"data-focused":O||void 0,"data-focus-visible":V||void 0,"data-current":!!e["aria-current"]||void 0,className:(0,P.link)({size:i,align:L,color:y,variant:p,weight:C,transform:E,underline:H}),children:a})}const v=(0,l.forwardRef)(K);
|
|
2
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/link.tsx"],
|
|
4
|
+
"sourcesContent": ["import { LinkContext, TextContext, useContextProps, type SlotProps } from 'react-aria-components';\nimport { filterDOMProps, mergeRefs } from '@react-aria/utils';\nimport {\n forwardRef,\n isValidElement,\n type ElementType,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\nimport { mergeProps, useFocusRing, useHover, useLink } from 'react-aria';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useRef } from 'react';\nimport type { AriaLinkOptions, HoverEvents } from 'react-aria';\n\nimport { link, type LinkVariantProps } from '../variants/index.js';\nimport { fallbackEventTo } from '../utils/helpers.js';\n\nexport interface LinkProps\n extends Omit<AriaLinkOptions, 'elementType'>,\n SlotProps,\n HoverEvents,\n LinkVariantProps {\n asChild?: boolean;\n children?: ReactNode;\n}\n\nfunction _Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n // @ts-ignore\n [props, ref] = useContextProps(props, ref, TextContext);\n [props, ref] = useContextProps(props, ref, LinkContext);\n const { asChild, children, size, align, color, variant, weight, transform, underline } = props;\n let elementType = asChild\n ? (isValidElement(children) && (children?.type as ElementType)) || 'a'\n : 'a';\n\n const [onPress, onClick] = fallbackEventTo(props, 'onPress', 'onClick');\n const [onPressStart, onPointerDown] = fallbackEventTo(props, 'onPressStart', 'onPointerDown');\n const [onHoverStart, onPointerMove] = fallbackEventTo(props, 'onHoverStart', 'onPointerMove');\n const [onHoverEnd, onPointerLeave] = fallbackEventTo(props, 'onHoverEnd', 'onPointerLeave');\n const innerRef = useRef<HTMLAnchorElement>(null);\n let { linkProps, isPressed } = useLink(\n {\n ...props,\n // @ts-ignore\n elementType,\n onPress,\n onPressStart,\n // @ts-ignore\n onClick,\n // @ts-ignore\n onPointerDown,\n // @ts-ignore\n onPointerMove,\n // @ts-ignore\n onPointerLeave,\n },\n innerRef,\n );\n let { focusProps, isFocused, isFocusVisible } = useFocusRing(props);\n\n let { hoverProps, isHovered } = useHover({\n ...props,\n onHoverStart,\n onHoverEnd,\n });\n\n let Comp = asChild ? Slot : 'a';\n\n return (\n <Comp\n {...filterDOMProps(props)}\n {...mergeProps(linkProps, focusProps, hoverProps)}\n slot={props.slot || undefined}\n ref={mergeRefs(ref, innerRef)}\n data-disabled={props.isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n data-current={!!props['aria-current'] || undefined}\n className={link({ size, align, color, variant, weight, transform, underline })}\n >\n {children}\n </Comp>\n );\n}\n\nconst Link = /*#__PURE__*/ forwardRef(_Link);\nexport { Link };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAqEI,IAAAI,EAAA,6BArEJC,EAA0E,iCAC1EC,EAA0C,6BAC1CC,EAMO,iBACPC,EAA4D,sBAC5DC,EAAqB,gCACrBF,EAAuB,iBAGvBG,EAA4C,gCAC5CC,EAAgC,+BAWhC,SAASC,EAAMC,EAAkBC,EAAsC,CAErE,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,aAAW,EACtD,CAACD,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,aAAW,EACtD,KAAM,CAAE,QAAAC,EAAS,SAAAC,EAAU,KAAAC,EAAM,MAAAC,EAAO,MAAAC,EAAO,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,CAAU,EAAIV,EACzF,IAAIW,EAAcT,MACb,kBAAeC,CAAQ,GAAMA,GAAU,MAAyB,IAGrE,KAAM,CAACS,EAASC,CAAO,KAAI,mBAAgBb,EAAO,UAAW,SAAS,EAChE,CAACc,EAAcC,CAAa,KAAI,mBAAgBf,EAAO,eAAgB,eAAe,EACtF,CAACgB,EAAcC,CAAa,KAAI,mBAAgBjB,EAAO,eAAgB,eAAe,EACtF,CAACkB,EAAYC,CAAc,KAAI,mBAAgBnB,EAAO,aAAc,gBAAgB,EACpFoB,KAAW,UAA0B,IAAI,EAC/C,GAAI,CAAE,UAAAC,EAAW,UAAAC,CAAU,KAAI,WAC7B,CACE,GAAGtB,EAEH,YAAAW,EACA,QAAAC,EACA,aAAAE,EAEA,QAAAD,EAEA,cAAAE,EAEA,cAAAE,EAEA,eAAAE,CACF,EACAC,CACF,EACI,CAAE,WAAAG,EAAY,UAAAC,EAAW,eAAAC,CAAe,KAAI,gBAAazB,CAAK,EAE9D,CAAE,WAAA0B,EAAY,UAAAC,CAAU,KAAI,YAAS,CACvC,GAAG3B,EACH,aAAAgB,EACA,WAAAE,CACF,CAAC,EAID,SACE,OAHShB,EAAU,OAAO,IAGzB,CACE,MAAG,kBAAeF,CAAK,EACvB,MAAG,cAAWqB,EAAWE,EAAYG,CAAU,EAChD,KAAM1B,EAAM,MAAQ,OACpB,OAAK,aAAUC,EAAKmB,CAAQ,EAC5B,gBAAepB,EAAM,YAAc,OACnC,eAAcsB,GAAa,OAC3B,eAAcK,GAAa,OAC3B,eAAcH,GAAa,OAC3B,qBAAoBC,GAAkB,OAEtC,eAAc,CAAC,CAACzB,EAAM,cAAc,GAAK,OACzC,aAAW,QAAK,CAAE,KAAAI,EAAM,MAAAC,EAAO,MAAAC,EAAO,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,CAAU,CAAC,EAE5E,SAAAP,EACH,CAEJ,CAEA,MAAMd,KAAqB,cAAWU,CAAK",
|
|
6
|
+
"names": ["link_exports", "__export", "Link", "__toCommonJS", "import_jsx_runtime", "import_react_aria_components", "import_utils", "import_react", "import_react_aria", "import_react_slot", "import_variants", "import_helpers", "_Link", "props", "ref", "asChild", "children", "size", "align", "color", "variant", "weight", "transform", "underline", "elementType", "onPress", "onClick", "onPressStart", "onPointerDown", "onHoverStart", "onPointerMove", "onHoverEnd", "onPointerLeave", "innerRef", "linkProps", "isPressed", "focusProps", "isFocused", "isFocusVisible", "hoverProps", "isHovered"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NumberFieldProps as BaseNumberFieldProps, ValidationResult } from 'react-aria-components';
|
|
3
|
+
import type { TextFieldVariantProps } from '../variants/index.js';
|
|
4
|
+
interface NumberFieldProps extends BaseNumberFieldProps, TextFieldVariantProps {
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string | ReactNode;
|
|
8
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
9
|
+
}
|
|
10
|
+
declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { NumberField };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var S=(i,t)=>{for(var l in t)b(i,l,{get:t[l],enumerable:!0})},U=(i,t,l,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of A(t))!O.call(i,d)&&d!==l&&b(i,d,{get:()=>t[d],enumerable:!(a=j(t,d))||a.enumerable});return i};var _=i=>U(b({},"__esModule",{value:!0}),i);var k={};S(k,{NumberField:()=>w});module.exports=_(k);var e=require("react/jsx-runtime"),N=require("@radix-ui/react-use-rect"),u=require("react-aria-components"),F=require("react-stately"),m=require("../utils/cn.js"),P=require("../variants/field-error.js"),R=require("../variants/index.js"),n=require("./index.js"),y=require("@react-aria/utils"),p=require("lucide-react"),s=require("react"),c=require("react-aria"),T=require("../utils/helpers.js");function $({label:i,description:t,errorMessage:l,size:a="medium",roundness:d="medium",elevation:f="medium",...r},g){const[E,B]=(0,s.useState)(null),v=(0,N.useRect)(E);[r,g]=(0,u.useContextProps)(r,g,u.NumberFieldContext);let{locale:D}=(0,c.useLocale)(),x=(0,F.useNumberFieldState)({...r,locale:D}),h=(0,s.useRef)(null),{labelProps:V,groupProps:q,inputProps:C,incrementButtonProps:I,decrementButtonProps:L,descriptionProps:H,errorMessageProps:M,...o}=(0,c.useNumberField)({...(0,T.removeDataAttributes)(r),label:i},x,h);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(n.Flex,{gap:2,direction:"column",...(0,y.filterDOMProps)(r),ref:g,slot:r.slot||void 0,"data-disabled":r.isDisabled||void 0,"data-invalid":o.isInvalid||void 0,children:[i&&(0,e.jsx)(n.Text,{...V,size:1,transform:"uppercase",weight:"semibold",variant:"tertiary",color:"gray",children:i}),(0,e.jsxs)("div",{...q,className:"relative","data-radius":d,"data-shadow":f,children:[(0,e.jsx)("input",{...C,ref:h,style:{"--append-padding-right":v?`${v.width}px`:0},className:(0,m.cn)("dx","w-full",(0,R.textField)({size:a,roundness:d,elevation:f})),"data-disabled":r.isDisabled||void 0,"data-invalid":o.isInvalid||void 0,"data-readonly":r.isReadOnly||void 0,"data-required":r.isRequired||void 0}),(0,e.jsxs)(n.Flex,{ref:B,direction:["large","extralarge"].includes(a)?"column":"row-reverse",align:["large","extralarge"].includes(a)?"start":"center",justify:["large","extralarge"].includes(a)?"center":"start",className:(0,m.cn)("absolute top-[0] bottom-[0] transform",{"right-3":["extrasmall","small"].includes(a),"right-4":["medium","large"].includes(a),"right-6":a==="extralarge"}),children:[(0,e.jsx)(n.Button,{...I,size:"extrasmall",shape:"square",variant:"ghost",mode:"subtle",inset:"right",slot:"increment",children:(0,e.jsx)(p.ChevronUp,{})}),(0,e.jsx)(n.Button,{...L,size:"extrasmall",shape:"square",variant:"ghost",mode:"subtle",inset:"right",slot:"decrement",children:(0,e.jsx)(p.ChevronDown,{})})]}),o.isInvalid&&(0,e.jsx)(n.Text,{...M,size:1,className:(0,m.cn)("dx",(0,P.fieldError)({size:a,roundness:d,elevation:f})),children:l?typeof l=="string"?l:l(o):o.validationErrors.length===0?void 0:o.validationErrors.join(" ")})]}),t&&(0,e.jsx)(n.Text,{size:1,variant:"tertiary",...H,children:t})]}),r.name&&(0,e.jsx)("input",{type:"hidden",name:r.name,value:isNaN(x.numberValue)?"":x.numberValue})]})}const w=(0,s.forwardRef)($);
|
|
2
|
+
//# sourceMappingURL=number-field.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/number-field.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useRect } from '@radix-ui/react-use-rect';\nimport { NumberFieldContext, useContextProps } from 'react-aria-components';\nimport { useNumberFieldState } from 'react-stately';\nimport { cn } from '../utils/cn.js';\nimport { fieldError } from '../variants/field-error.js';\nimport { textField } from '../variants/index.js';\nimport { Button, Flex, Text } from './index.js';\nimport { filterDOMProps } from '@react-aria/utils';\nimport { ChevronDown, ChevronUp } from 'lucide-react';\nimport { forwardRef, useRef, useState, type ReactNode } from 'react';\nimport { useLocale, useNumberField } from 'react-aria';\nimport { removeDataAttributes } from '../utils/helpers.js';\nimport type {\n NumberFieldProps as BaseNumberFieldProps,\n ValidationResult,\n} from 'react-aria-components';\nimport type { TextFieldVariantProps } from '../variants/index.js';\n\ninterface NumberFieldProps extends BaseNumberFieldProps, TextFieldVariantProps {\n placeholder?: string;\n label?: string;\n description?: string | ReactNode;\n errorMessage?: string | ((validation: ValidationResult) => string);\n}\n\nfunction _NumberField(\n {\n label,\n description,\n errorMessage,\n size = 'medium',\n roundness = 'medium',\n elevation = 'medium',\n ...props\n }: NumberFieldProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n) {\n const [appendEl, setAppendEl] = useState<HTMLDivElement | null>(null);\n const appendRect = useRect(appendEl);\n [props, ref] = useContextProps(props, ref, NumberFieldContext);\n\n let { locale } = useLocale();\n let state = useNumberFieldState({\n ...props,\n locale,\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n\n let {\n labelProps,\n groupProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useNumberField(\n {\n ...removeDataAttributes(props),\n label,\n },\n state,\n inputRef,\n );\n\n return (\n <>\n <Flex\n gap={2}\n direction=\"column\"\n {...filterDOMProps(props)}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n >\n {label && (\n <Text\n {...labelProps}\n size={1}\n transform=\"uppercase\"\n weight=\"semibold\"\n variant=\"tertiary\"\n color=\"gray\"\n >\n {label}\n </Text>\n )}\n <div {...groupProps} className=\"relative\" data-radius={roundness} data-shadow={elevation}>\n <input\n {...inputProps}\n ref={inputRef}\n style={{\n // @ts-ignore\n '--append-padding-right': appendRect ? `${appendRect.width}px` : 0,\n }}\n className={cn('dx', 'w-full', textField({ size, roundness, elevation }))}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}\n />\n <Flex\n ref={setAppendEl}\n direction={['large', 'extralarge'].includes(size) ? 'column' : 'row-reverse'}\n align={['large', 'extralarge'].includes(size) ? 'start' : 'center'}\n justify={['large', 'extralarge'].includes(size) ? 'center' : 'start'}\n className={cn('absolute top-[0] bottom-[0] transform', {\n 'right-3': ['extrasmall', 'small'].includes(size),\n 'right-4': ['medium', 'large'].includes(size),\n 'right-6': size === 'extralarge',\n })}\n >\n <Button\n {...incrementButtonProps}\n size=\"extrasmall\"\n shape=\"square\"\n variant=\"ghost\"\n mode=\"subtle\"\n inset=\"right\"\n slot=\"increment\"\n >\n <ChevronUp />\n </Button>\n <Button\n {...decrementButtonProps}\n size=\"extrasmall\"\n shape=\"square\"\n variant=\"ghost\"\n mode=\"subtle\"\n inset=\"right\"\n slot=\"decrement\"\n >\n <ChevronDown />\n </Button>\n </Flex>\n {validation.isInvalid && (\n <Text\n {...errorMessageProps}\n size={1}\n className={cn('dx', fieldError({ size, roundness, elevation }))}\n >\n {errorMessage\n ? typeof errorMessage === 'string'\n ? errorMessage\n : errorMessage(validation)\n : validation.validationErrors.length === 0\n ? undefined\n : validation.validationErrors.join(' ')}\n </Text>\n )}\n </div>\n {description && (\n <Text size={1} variant=\"tertiary\" {...descriptionProps}>\n {description}\n </Text>\n )}\n </Flex>\n {props.name && (\n <input\n type=\"hidden\"\n name={props.name}\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n )}\n </>\n );\n}\n\nconst NumberField = forwardRef(_NumberField);\n\nexport { NumberField };\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAoEI,IAAAI,EAAA,6BApEJC,EAAwB,oCACxBC,EAAoD,iCACpDC,EAAoC,yBACpCC,EAAmB,0BACnBC,EAA2B,sCAC3BC,EAA0B,gCAC1BC,EAAmC,sBACnCC,EAA+B,6BAC/BC,EAAuC,wBACvCC,EAA6D,iBAC7DC,EAA0C,sBAC1CC,EAAqC,+BAcrC,SAASC,EACP,CACE,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,SACP,UAAAC,EAAY,SACZ,UAAAC,EAAY,SACZ,GAAGC,CACL,EACAC,EACA,CACA,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAgC,IAAI,EAC9DC,KAAa,WAAQF,CAAQ,EACnC,CAACF,EAAOC,CAAG,KAAI,mBAAgBD,EAAOC,EAAK,oBAAkB,EAE7D,GAAI,CAAE,OAAAI,CAAO,KAAI,aAAU,EACvBC,KAAQ,uBAAoB,CAC9B,GAAGN,EACH,OAAAK,CACF,CAAC,EAEGE,KAAW,UAAyB,IAAI,EAExC,CACF,WAAAC,EACA,WAAAC,EACA,WAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,GAAGC,CACL,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AM,SACN,QAAQ,QACR,KAAK,SACL,MAAM,QACN,KAAK,YAEL,mBAAC,gBAAY,EACf,GACF,EACCG,EAAW,cACV,OAAC,QACE,GAAGD,EACJ,KAAM,EACN,aAAW,MAAG,QAAM,cAAW,CAAE,KAAAjB,EAAM,UAAAC,EAAW,UAAAC,CAAU,CAAC,CAAC,EAE7D,SAAAH,EACG,OAAOA,GAAiB,SACtBA,EACAA,EAAamB,CAAU,EACzBA,EAAW,iBAAiB,SAAW,EACrC,OACAA,EAAW,iBAAiB,KAAK,GAAG,EAC5C,GAEJ,EACCpB,MACC,OAAC,QAAK,KAAM,EAAG,QAAQ,WAAY,GAAGkB,EACnC,SAAAlB,EACH,GAEJ,EACCK,EAAM,SACL,OAAC,SACC,KAAK,SACL,KAAMA,EAAM,KACZ,MAAO,MAAMM,EAAM,WAAW,EAAI,GAAKA,EAAM,YAC/C,GAEJ,CAEJ,CAEA,MAAM5B,KAAc,cAAWe,CAAY",
|
|
6
|
+
"names": ["number_field_exports", "__export", "NumberField", "__toCommonJS", "import_jsx_runtime", "import_react_use_rect", "import_react_aria_components", "import_react_stately", "import_cn", "import_field_error", "import_variants", "import_index", "import_utils", "import_lucide_react", "import_react", "import_react_aria", "import_helpers", "_NumberField", "label", "description", "errorMessage", "size", "roundness", "elevation", "props", "ref", "appendEl", "setAppendEl", "appendRect", "locale", "state", "inputRef", "labelProps", "groupProps", "inputProps", "incrementButtonProps", "decrementButtonProps", "descriptionProps", "errorMessageProps", "validation"]
|
|
7
|
+
}
|