@atom-learning/components 5.4.4 → 5.5.0-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/components/banner/Banner.d.ts +2 -2
- package/dist/components/banner/banner-regular/BannerRegular.d.ts +92 -459
- package/dist/components/banner/banner-slim/BannerSlim.d.ts +92 -459
- package/dist/components/checkbox-group/CheckboxGroup.d.ts +90 -90
- package/dist/components/checkbox-tree/CheckboxTree.d.ts +344 -344
- package/dist/components/create-password-field/CreatePasswordField.d.ts +1 -1
- package/dist/components/create-password-field/CreatePasswordField.js +1 -1
- package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +110 -98
- package/dist/components/date-field/DateField.d.ts +1 -1
- package/dist/components/date-field/DateField.js +1 -1
- package/dist/components/date-field/DateField.js.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +2 -2
- package/dist/components/dismissible/index.d.ts +2 -2
- package/dist/components/dismissible-group/index.d.ts +3 -3
- package/dist/components/field-wrapper/FieldWrapper.d.ts +3 -1
- package/dist/components/field-wrapper/FieldWrapper.js +1 -1
- package/dist/components/field-wrapper/FieldWrapper.js.map +1 -1
- package/dist/components/heading/Heading.d.ts +1 -0
- package/dist/components/heading/Heading.js +1 -1
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/input/Input.d.ts +3 -1
- package/dist/components/input/Input.js +1 -1
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input-field/InputField.d.ts +1 -1
- package/dist/components/input-field/InputField.js +1 -1
- package/dist/components/input-field/InputField.js.map +1 -1
- package/dist/components/keyboard-shortcut/index.d.ts +2 -2
- package/dist/components/label/Label.d.ts +2 -1
- package/dist/components/label/Label.js +1 -1
- package/dist/components/label/Label.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVertical.d.ts +162 -162
- package/dist/components/number-input/NumberInput.d.ts +2 -1
- package/dist/components/number-input/NumberInput.js +1 -1
- package/dist/components/number-input/NumberInput.js.map +1 -1
- package/dist/components/number-input/NumberInputStepper.d.ts +756 -1
- package/dist/components/number-input/NumberInputStepper.js +1 -1
- package/dist/components/number-input/NumberInputStepper.js.map +1 -1
- package/dist/components/number-input-field/NumberInputField.d.ts +1 -1
- package/dist/components/number-input-field/NumberInputField.js +1 -1
- package/dist/components/number-input-field/NumberInputField.js.map +1 -1
- package/dist/components/password-field/PasswordField.d.ts +1 -1
- package/dist/components/password-field/PasswordField.js +1 -1
- package/dist/components/password-field/PasswordField.js.map +1 -1
- package/dist/components/search-field/SearchField.d.ts +1 -1
- package/dist/components/search-field/SearchField.js +1 -1
- package/dist/components/search-field/SearchField.js.map +1 -1
- package/dist/components/search-input/SearchInput.js +1 -1
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts +9 -9
- package/dist/components/select/Select.d.ts +1 -0
- package/dist/components/select/Select.js +1 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-field/SelectField.d.ts +1 -1
- package/dist/components/select-field/SelectField.js +1 -1
- package/dist/components/select-field/SelectField.js.map +1 -1
- package/dist/components/side-bar/SideBarComponents.d.ts +1 -1
- package/dist/components/sortable/index.d.ts +3 -3
- package/dist/components/stepper/StepperStepLabel.d.ts +1 -1
- package/dist/components/textarea/Textarea.d.ts +1 -0
- package/dist/components/textarea/Textarea.js +1 -1
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea-field/TextareaField.d.ts +1 -1
- package/dist/components/textarea-field/TextareaField.js +1 -1
- package/dist/components/textarea-field/TextareaField.js.map +1 -1
- package/dist/components/tile/Tile.d.ts +1 -0
- package/dist/components/tile/Tile.js +1 -1
- package/dist/components/tile/Tile.js.map +1 -1
- package/dist/components/tile-interactive/TileInteractive.d.ts +2 -1
- package/dist/components/tile-toggle-group/TileToggleGroupItem.d.ts +2 -1
- package/dist/components/toggle-group/index.d.ts +2 -2
- package/dist/components/top-bar/TopBar.d.ts +2 -1
- package/dist/components/top-bar/TopBar.js +1 -1
- package/dist/components/top-bar/TopBar.js.map +1 -1
- package/dist/components/tree/Tree.d.ts +243 -243
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { disabledStyle } from '~/utilities'\nimport { overrideStitchesVariantValue } from '~/utilities/override-stitches-variant-value/overrideStitchesVariantValue'\n\nimport { Flex } from '../flex'\nimport { Text } from '../text'\n\nexport const InputBackground = styled(Flex, {\n
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { disabledStyle } from '~/utilities'\nimport { overrideStitchesVariantValue } from '~/utilities/override-stitches-variant-value/overrideStitchesVariantValue'\n\nimport { Flex } from '../flex'\nimport { Text } from '../text'\n\nexport const InputBackground = styled(Flex, {\n border: '1px solid',\n color: '$grey1000',\n transition: 'background 100ms ease-out, borderColor 100ms ease-out',\n width: '100%',\n '&:focus-within': {\n borderColor: '$blue800'\n },\n '&::placeholder': {\n color: '$grey700',\n opacity: 1\n },\n variants: {\n appearance: {\n standard: {\n background: 'white',\n borderColor: '$grey800',\n borderRadius: '$0'\n },\n modern: {\n background: '$grey100',\n borderColor: '$grey100',\n borderRadius: '$1'\n }\n },\n size: {\n sm: {\n height: '$3'\n },\n md: {\n height: '$4'\n },\n lg: {\n height: '$5'\n },\n xl: {\n height: '$6'\n }\n },\n disabled: {\n true: disabledStyle\n },\n state: {\n error: {\n borderColor: '$danger'\n }\n }\n }\n})\n\nInputBackground.displayName = 'InputBackground'\n\nconst StyledInputText = styled.withConfig({\n shouldForwardStitchesProp: (propName) => ['as'].includes(propName)\n})(Text as unknown as 'input', {\n // unsets\n appearance: 'none',\n border: 'none',\n background: 'none',\n backgroundImage: 'none',\n backgroundColor: 'transparent',\n boxShadow: 'none', // prevent default iOS default styling\n boxSizing: 'border-box',\n '&:focus': {\n outline: 'none'\n },\n //\n px: '$3',\n size: '100%'\n})\n\nexport type InputTextProps = Omit<\n React.ComponentProps<typeof StyledInputText>,\n 'size' | 'type' | 'as'\n> & {\n size: React.ComponentProps<typeof Text>['size']\n // override default 'type' property to prevent Input from being used to render\n // checkboxes, radios etc — we have dedicated components for them\n type?: 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'search'\n as?: never\n}\n\nconst toTextSize = {\n sm: 'sm',\n md: 'md',\n lg: 'md',\n xl: 'lg'\n}\n\nexport const InputText: React.ForwardRefExoticComponent<InputTextProps> =\n React.forwardRef(({ type = 'text', css, size, ...rest }, ref) => {\n const textSize = React.useMemo(\n () => overrideStitchesVariantValue(size, (s) => toTextSize[s]),\n [size]\n )\n\n return (\n <StyledInputText\n ref={ref}\n as=\"input\"\n type={type === 'number' ? 'text' : type}\n inputMode={type === 'number' ? 'numeric' : undefined}\n pattern={type === 'number' ? '[0-9]*' : undefined}\n size={textSize}\n {...rest}\n />\n )\n })\n\nInputText.displayName = 'InputText'\n\ntype InputBackgroundProps = React.ComponentProps<typeof InputBackground>\nexport type InputProps = Omit<\n React.ComponentProps<typeof InputText>,\n 'size' | 'state' | 'appearance'\n> & {\n size?: InputBackgroundProps['size']\n state?: InputBackgroundProps['state']\n appearance?: InputBackgroundProps['appearance']\n}\n\nexport const Input: React.ForwardRefExoticComponent<InputProps> =\n React.forwardRef(\n (\n {\n className,\n size = 'md',\n appearance = 'standard',\n state,\n disabled,\n css,\n ...rest\n },\n ref\n ) => {\n return (\n <InputBackground\n size={size}\n appearance={appearance}\n disabled={disabled}\n state={state}\n css={css}\n className={className}\n >\n <InputText size={size} ref={ref} disabled={disabled} {...rest} />\n </InputBackground>\n )\n }\n )\n\nInput.displayName = 'Input'\n"],"names":["InputBackground","styled","Flex","disabledStyle","StyledInputText","propName","Text","toTextSize","InputText","React","type","css","size","rest","ref","textSize","overrideStitchesVariantValue","s","Input","className","appearance","state","disabled"],"mappings":"qhBASaA,EAAkBC,EAAOC,EAAM,CAC1C,OAAQ,YACR,MAAO,YACP,WAAY,wDACZ,MAAO,OACP,iBAAkB,CAChB,YAAa,UACf,EACA,iBAAkB,CAChB,MAAO,WACP,QAAS,CACX,EACA,SAAU,CACR,WAAY,CACV,SAAU,CACR,WAAY,QACZ,YAAa,WACb,aAAc,IAChB,EACA,OAAQ,CACN,WAAY,WACZ,YAAa,WACb,aAAc,IAChB,CACF,EACA,KAAM,CACJ,GAAI,CACF,OAAQ,IACV,EACA,GAAI,CACF,OAAQ,IACV,EACA,GAAI,CACF,OAAQ,IACV,EACA,GAAI,CACF,OAAQ,IACV,CACF,EACA,SAAU,CACR,KAAMC,CACR,EACA,MAAO,CACL,MAAO,CACL,YAAa,SACf,CACF,CACF,CACF,CAAC,EAEDH,EAAgB,YAAc,kBAE9B,MAAMI,EAAkBH,EAAO,WAAW,CACxC,0BAA4BI,GAAa,CAAC,IAAI,EAAE,SAASA,CAAQ,CACnE,CAAC,EAAEC,EAA4B,CAE7B,WAAY,OACZ,OAAQ,OACR,WAAY,OACZ,gBAAiB,OACjB,gBAAiB,cACjB,UAAW,OACX,UAAW,aACX,UAAW,CACT,QAAS,MACX,EAEA,GAAI,KACJ,KAAM,MACR,CAAC,EAaKC,EAAa,CACjB,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAEaC,EACXC,EAAM,WAAW,CAAC,CAAE,KAAAC,EAAO,OAAQ,IAAAC,EAAK,KAAAC,KAASC,CAAK,EAAGC,IAAQ,CAC/D,MAAMC,EAAWN,EAAM,QACrB,IAAMO,EAA6BJ,EAAOK,GAAMV,EAAWU,EAAE,EAC7D,CAACL,CAAI,CACP,EAEA,OACEH,EAAA,cAACL,EAAA,CACC,IAAKU,EACL,GAAG,QACH,KAAMJ,IAAS,SAAW,OAASA,EACnC,UAAWA,IAAS,SAAW,UAAY,OAC3C,QAASA,IAAS,SAAW,SAAW,OACxC,KAAMK,EACL,GAAGF,CAAAA,CACN,CAEJ,CAAC,EAEHL,EAAU,YAAc,YAYjB,MAAMU,EACXT,EAAM,WACJ,CACE,CACE,UAAAU,EACA,KAAAP,EAAO,KACP,WAAAQ,EAAa,WACb,MAAAC,EACA,SAAAC,EACA,IAAAX,KACGE,CACL,EACAC,IAGEL,EAAA,cAACT,GACC,KAAMY,EACN,WAAYQ,EACZ,SAAUE,EACV,MAAOD,EACP,IAAKV,EACL,UAAWQ,CAEXV,EAAAA,EAAA,cAACD,EAAA,CAAU,KAAMI,EAAM,IAAKE,EAAK,SAAUQ,EAAW,GAAGT,CAAM,CAAA,CACjE,CAGN,EAEFK,EAAM,YAAc"}
|
|
@@ -3,7 +3,7 @@ import { FieldElementWrapperProps } from '../../components/field-wrapper';
|
|
|
3
3
|
import { InputProps } from '../../components/input';
|
|
4
4
|
type InputFieldProps = InputProps & FieldElementWrapperProps;
|
|
5
5
|
export declare const InputField: {
|
|
6
|
-
({ css, label, name, validation, prompt, description, hideLabel, ...remainingProps }: InputFieldProps): React.JSX.Element;
|
|
6
|
+
({ css, label, name, validation, prompt, description, hideLabel, appearance, ...remainingProps }: InputFieldProps): React.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as a from"react";import{useFormContext as f}from"react-hook-form";import{FieldWrapper as F}from"../field-wrapper/FieldWrapper.js";import"../field-wrapper/InlineFieldWrapper.js";import"../form/Form.js";import{useFieldError as b}from"../form/useFieldError.js";import{Input as I}from"../input/Input.js";const p=({css:m,label:n,name:e,validation:r,prompt:l,description:d,hideLabel:s,appearance:o,...c})=>{const{register:t}=f(),{error:i}=b(e),u=r?t(r):t;return a.createElement(F,{css:m,description:d,error:i,fieldId:e,hideLabel:s,label:n,prompt:l,required:Boolean(r==null?void 0:r.required),appearance:o},a.createElement(I,{id:e,name:e,ref:u,appearance:o,...i&&{state:"error"},...c}))};p.displayName="InputField";export{p as InputField};
|
|
2
2
|
//# sourceMappingURL=InputField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.js","sources":["../../../src/components/input-field/InputField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper'\nimport { useFieldError } from '~/components/form'\nimport { Input, InputProps } from '~/components/input'\n\ntype InputFieldProps = InputProps & FieldElementWrapperProps\n\nexport const InputField = ({\n css,\n label,\n name,\n validation,\n prompt,\n description,\n hideLabel,\n ...remainingProps\n}: InputFieldProps) => {\n const { register } = useFormContext()\n const { error } = useFieldError(name)\n const ref = validation ? register(validation) : register\n\n return (\n <FieldWrapper\n css={css}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n >\n <Input\n id={name}\n name={name}\n ref={ref}\n {...(error && { state: 'error' })}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nInputField.displayName = 'InputField'\n"],"names":["InputField","css","label","name","validation","prompt","description","hideLabel","remainingProps","register","useFormContext","error","useFieldError","ref","React","FieldWrapper","Input"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputField.js","sources":["../../../src/components/input-field/InputField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useFormContext } from 'react-hook-form'\n\nimport {\n FieldElementWrapperProps,\n FieldWrapper\n} from '~/components/field-wrapper'\nimport { useFieldError } from '~/components/form'\nimport { Input, InputProps } from '~/components/input'\n\ntype InputFieldProps = InputProps & FieldElementWrapperProps\n\nexport const InputField = ({\n css,\n label,\n name,\n validation,\n prompt,\n description,\n hideLabel,\n appearance,\n ...remainingProps\n}: InputFieldProps) => {\n const { register } = useFormContext()\n const { error } = useFieldError(name)\n const ref = validation ? register(validation) : register\n\n return (\n <FieldWrapper\n css={css}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n appearance={appearance}\n >\n <Input\n id={name}\n name={name}\n ref={ref}\n appearance={appearance}\n {...(error && { state: 'error' })}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nInputField.displayName = 'InputField'\n"],"names":["InputField","css","label","name","validation","prompt","description","hideLabel","appearance","remainingProps","register","useFormContext","error","useFieldError","ref","React","FieldWrapper","Input"],"mappings":"mTAYO,MAAMA,EAAa,CAAC,CACzB,IAAAC,EACA,MAAAC,EACA,KAAAC,EACA,WAAAC,EACA,OAAAC,EACA,YAAAC,EACA,UAAAC,EACA,WAAAC,KACGC,CACL,IAAuB,CACrB,KAAM,CAAE,SAAAC,CAAS,EAAIC,EAAe,EAC9B,CAAE,MAAAC,CAAM,EAAIC,EAAcV,CAAI,EAC9BW,EAAMV,EAAaM,EAASN,CAAU,EAAIM,EAEhD,OACEK,EAAA,cAACC,EAAA,CACC,IAAKf,EACL,YAAaK,EACb,MAAOM,EACP,QAAST,EACT,UAAWI,EACX,MAAOL,EACP,OAAQG,EACR,SAAU,QAAQD,GAAA,KAAAA,OAAAA,EAAY,QAAQ,EACtC,WAAYI,CAEZO,EAAAA,EAAA,cAACE,EAAA,CACC,GAAId,EACJ,KAAMA,EACN,IAAKW,EACL,WAAYN,EACX,GAAII,GAAS,CAAE,MAAO,OAAQ,EAC9B,GAAGH,CAAAA,CACN,CACF,CAEJ,EAEAT,EAAW,YAAc"}
|
|
@@ -370,7 +370,7 @@ export declare const KeyboardShortcut: import("react").ForwardRefExoticComponent
|
|
|
370
370
|
config: {
|
|
371
371
|
shortcut: Partial<KeyboardEvent>;
|
|
372
372
|
action: ({ event, shortcut }: {
|
|
373
|
-
event: KeyboardEvent |
|
|
373
|
+
event: KeyboardEvent | React.KeyboardEvent<HTMLDivElement>;
|
|
374
374
|
shortcut: Partial<KeyboardEvent>;
|
|
375
375
|
}) => void;
|
|
376
376
|
}[];
|
|
@@ -751,7 +751,7 @@ export declare const KeyboardShortcut: import("react").ForwardRefExoticComponent
|
|
|
751
751
|
};
|
|
752
752
|
}> | undefined;
|
|
753
753
|
}, "as"> & {
|
|
754
|
-
as?: "blockquote" | "caption" | "dd" | "dt" | "figcaption" | "li" | "p" | "span" | "legend" |
|
|
754
|
+
as?: "blockquote" | "caption" | "dd" | "dt" | "figcaption" | "li" | "p" | "span" | "legend" | React.ComponentType | React.ElementType;
|
|
755
755
|
}, "css"> & import("@atom-learning/stitches-react/types/styled-component").TransformProps<{}, {
|
|
756
756
|
sm: string;
|
|
757
757
|
md: string;
|
|
@@ -5,6 +5,7 @@ declare const StyledLabel: import("@atom-learning/stitches-react/types/styled-co
|
|
|
5
5
|
type?: "inline" | "block" | undefined;
|
|
6
6
|
align?: "center" | "start" | undefined;
|
|
7
7
|
direction?: "row" | "reverse" | undefined;
|
|
8
|
+
appearance?: "standard" | "modern" | undefined;
|
|
8
9
|
}, {
|
|
9
10
|
sm: string;
|
|
10
11
|
md: string;
|
|
@@ -369,7 +370,7 @@ declare const StyledLabel: import("@atom-learning/stitches-react/types/styled-co
|
|
|
369
370
|
marginBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
370
371
|
};
|
|
371
372
|
}>>;
|
|
372
|
-
type LabelProps = Override<React.ComponentPropsWithoutRef<typeof StyledLabel>, {
|
|
373
|
+
export type LabelProps = Override<React.ComponentPropsWithoutRef<typeof StyledLabel>, {
|
|
373
374
|
as?: 'label' | 'legend';
|
|
374
375
|
required?: boolean;
|
|
375
376
|
}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{styled as
|
|
1
|
+
import*as e from"react";import{styled as t}from"../../stitches.js";import{getTextVariant as i}from"../text/Text.js";const p=t("label",{color:"$grey900",fontFamily:"$body",m:0,variants:{size:{sm:i({size:"sm"}),md:i({size:"md"})},type:{block:{display:"block",fontWeight:600},inline:{display:"flex",fontWeight:400,maxWidth:"max-content"}},align:{start:{},center:{}},direction:{reverse:{},row:{}},appearance:{standard:{},modern:{}}},compoundVariants:[{type:"inline",align:"start",css:{alignItems:"flex-start"}},{type:"inline",align:"center",css:{alignItems:"center"}},{type:"inline",direction:"reverse",css:{flexDirection:"row-reverse"}},{type:"inline",direction:"row",css:{flexDirection:"row"}},{type:"block",appearance:"modern",css:{fontWeight:400}}]}),y=t("span",{color:"$danger",ml:"$1",fontWeight:400}),n=({align:r="start",as:a="label",direction:o="row",size:s="md",type:l="block",children:c,required:m,...d})=>e.createElement(p,{as:a,size:s,type:l,align:r,direction:o,...d},c,m&&e.createElement(y,{"aria-hidden":!0},"*"));n.displayName="Label";export{n as Label};
|
|
2
2
|
//# sourceMappingURL=Label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","sources":["../../../src/components/label/Label.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport type { Override } from '~/utilities/types'\n\nimport { getTextVariant } from '../text'\n\nconst StyledLabel = styled('label', {\n color: '$grey900',\n fontFamily: '$body',\n m: 0,\n variants: {\n size: {\n sm: getTextVariant({ size: 'sm' }),\n md: getTextVariant({ size: 'md' })\n },\n type: {\n block: {\n display: 'block',\n fontWeight: 600\n },\n inline: {\n display: 'flex',\n fontWeight: 400,\n maxWidth: 'max-content'\n }\n },\n align: { start: {}, center: {} },\n direction: { reverse: {}, row: {} }\n },\n compoundVariants: [\n {\n type: 'inline',\n align: 'start',\n css: { alignItems: 'flex-start' }\n },\n {\n type: 'inline',\n align: 'center',\n css: { alignItems: 'center' }\n },\n {\n type: 'inline',\n direction: 'reverse',\n css: { flexDirection: 'row-reverse' }\n },\n {\n type: 'inline',\n direction: 'row',\n css: { flexDirection: 'row' }\n }\n ]\n})\n\nconst StyledAsterisk = styled('span', {\n color: '$danger',\n ml: '$1',\n fontWeight: 400\n})\n\
|
|
1
|
+
{"version":3,"file":"Label.js","sources":["../../../src/components/label/Label.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport type { Override } from '~/utilities/types'\n\nimport { getTextVariant } from '../text'\n\nconst StyledLabel = styled('label', {\n color: '$grey900',\n fontFamily: '$body',\n m: 0,\n variants: {\n size: {\n sm: getTextVariant({ size: 'sm' }),\n md: getTextVariant({ size: 'md' })\n },\n type: {\n block: {\n display: 'block',\n fontWeight: 600\n },\n inline: {\n display: 'flex',\n fontWeight: 400,\n maxWidth: 'max-content'\n }\n },\n align: { start: {}, center: {} },\n direction: { reverse: {}, row: {} },\n appearance: { standard: {}, modern: {} }\n },\n compoundVariants: [\n {\n type: 'inline',\n align: 'start',\n css: { alignItems: 'flex-start' }\n },\n {\n type: 'inline',\n align: 'center',\n css: { alignItems: 'center' }\n },\n {\n type: 'inline',\n direction: 'reverse',\n css: { flexDirection: 'row-reverse' }\n },\n {\n type: 'inline',\n direction: 'row',\n css: { flexDirection: 'row' }\n },\n {\n type: 'block',\n appearance: 'modern',\n css: { fontWeight: 400 }\n }\n ]\n})\n\nconst StyledAsterisk = styled('span', {\n color: '$danger',\n ml: '$1',\n fontWeight: 400\n})\n\nexport type LabelProps = Override<\n React.ComponentPropsWithoutRef<typeof StyledLabel>,\n {\n as?: 'label' | 'legend'\n required?: boolean\n }\n>\n\nexport const Label = ({\n align = 'start',\n as = 'label',\n direction = 'row',\n size = 'md',\n type = 'block',\n children,\n required,\n ...rest\n}: LabelProps) => (\n <StyledLabel\n as={as}\n size={size}\n type={type}\n align={align}\n direction={direction}\n {...rest}\n >\n {children}\n {required && <StyledAsterisk aria-hidden>*</StyledAsterisk>}\n </StyledLabel>\n)\n\nLabel.displayName = 'Label'\n"],"names":["StyledLabel","styled","getTextVariant","StyledAsterisk","Label","align","as","direction","size","type","children","required","rest","React"],"mappings":"oHAOA,MAAMA,EAAcC,EAAO,QAAS,CAClC,MAAO,WACP,WAAY,QACZ,EAAG,EACH,SAAU,CACR,KAAM,CACJ,GAAIC,EAAe,CAAE,KAAM,IAAK,CAAC,EACjC,GAAIA,EAAe,CAAE,KAAM,IAAK,CAAC,CACnC,EACA,KAAM,CACJ,MAAO,CACL,QAAS,QACT,WAAY,GACd,EACA,OAAQ,CACN,QAAS,OACT,WAAY,IACZ,SAAU,aACZ,CACF,EACA,MAAO,CAAE,MAAO,GAAI,OAAQ,CAAA,CAAG,EAC/B,UAAW,CAAE,QAAS,CAAA,EAAI,IAAK,EAAG,EAClC,WAAY,CAAE,SAAU,CAAC,EAAG,OAAQ,CAAA,CAAG,CACzC,EACA,iBAAkB,CAChB,CACE,KAAM,SACN,MAAO,QACP,IAAK,CAAE,WAAY,YAAa,CAClC,EACA,CACE,KAAM,SACN,MAAO,SACP,IAAK,CAAE,WAAY,QAAS,CAC9B,EACA,CACE,KAAM,SACN,UAAW,UACX,IAAK,CAAE,cAAe,aAAc,CACtC,EACA,CACE,KAAM,SACN,UAAW,MACX,IAAK,CAAE,cAAe,KAAM,CAC9B,EACA,CACE,KAAM,QACN,WAAY,SACZ,IAAK,CAAE,WAAY,GAAI,CACzB,CACF,CACF,CAAC,EAEKC,EAAiBF,EAAO,OAAQ,CACpC,MAAO,UACP,GAAI,KACJ,WAAY,GACd,CAAC,EAUYG,EAAQ,CAAC,CACpB,MAAAC,EAAQ,QACR,GAAAC,EAAK,QACL,UAAAC,EAAY,MACZ,KAAAC,EAAO,KACP,KAAAC,EAAO,QACP,SAAAC,EACA,SAAAC,KACGC,CACL,IACEC,EAAA,cAACb,EAAA,CACC,GAAIM,EACJ,KAAME,EACN,KAAMC,EACN,MAAOJ,EACP,UAAWE,EACV,GAAGK,CAAAA,EAEHF,EACAC,GAAYE,EAAA,cAACV,EAAA,CAAe,cAAW,IAAC,GAAC,CAC5C,EAGFC,EAAM,YAAc"}
|
|
@@ -736,9 +736,9 @@ export declare const NavigationMenuVertical: (({ children, ...rest }: TNavigatio
|
|
|
736
736
|
as?: React.ComponentType | React.ElementType;
|
|
737
737
|
}) => React.JSX.Element;
|
|
738
738
|
Accordion: ({ defaultOpen, open, onOpenChange, disabled, ...rest }: import("@radix-ui/react-collapsible").CollapsibleProps & React.RefAttributes<HTMLDivElement> & {
|
|
739
|
-
color?: string | undefined;
|
|
740
|
-
content?: string | undefined;
|
|
741
|
-
translate?: "yes" | "no" | undefined;
|
|
739
|
+
color?: string | undefined | undefined;
|
|
740
|
+
content?: string | undefined | undefined;
|
|
741
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
742
742
|
css?: import("@atom-learning/stitches-react/types/css-util").CSS<{
|
|
743
743
|
sm: string;
|
|
744
744
|
md: string;
|
|
@@ -1095,106 +1095,106 @@ export declare const NavigationMenuVertical: (({ children, ...rest }: TNavigatio
|
|
|
1095
1095
|
marginBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
1096
1096
|
};
|
|
1097
1097
|
}> | undefined;
|
|
1098
|
-
prefix?: string | undefined;
|
|
1099
|
-
slot?: string | undefined;
|
|
1098
|
+
prefix?: string | undefined | undefined;
|
|
1099
|
+
slot?: string | undefined | undefined;
|
|
1100
1100
|
style?: React.CSSProperties | undefined;
|
|
1101
|
-
title?: string | undefined;
|
|
1101
|
+
title?: string | undefined | undefined;
|
|
1102
1102
|
ref?: React.Ref<HTMLLIElement> | undefined;
|
|
1103
1103
|
key?: React.Key | null | undefined;
|
|
1104
|
-
defaultChecked?: boolean | undefined;
|
|
1104
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
1105
1105
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
1106
|
-
suppressContentEditableWarning?: boolean | undefined;
|
|
1107
|
-
suppressHydrationWarning?: boolean | undefined;
|
|
1108
|
-
accessKey?: string | undefined;
|
|
1109
|
-
autoFocus?: boolean | undefined;
|
|
1110
|
-
className?: string | undefined;
|
|
1111
|
-
contentEditable?: (boolean | "true" | "false") |
|
|
1112
|
-
contextMenu?: string | undefined;
|
|
1113
|
-
dir?: string | undefined;
|
|
1106
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
1107
|
+
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
1108
|
+
accessKey?: string | undefined | undefined;
|
|
1109
|
+
autoFocus?: boolean | undefined | undefined;
|
|
1110
|
+
className?: string | undefined | undefined;
|
|
1111
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
1112
|
+
contextMenu?: string | undefined | undefined;
|
|
1113
|
+
dir?: string | undefined | undefined;
|
|
1114
1114
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
1115
|
-
hidden?: boolean | undefined;
|
|
1116
|
-
id?: string | undefined;
|
|
1117
|
-
lang?: string | undefined;
|
|
1118
|
-
nonce?: string | undefined;
|
|
1119
|
-
placeholder?: string | undefined;
|
|
1115
|
+
hidden?: boolean | undefined | undefined;
|
|
1116
|
+
id?: string | undefined | undefined;
|
|
1117
|
+
lang?: string | undefined | undefined;
|
|
1118
|
+
nonce?: string | undefined | undefined;
|
|
1119
|
+
placeholder?: string | undefined | undefined;
|
|
1120
1120
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
1121
|
-
tabIndex?: number | undefined;
|
|
1122
|
-
radioGroup?: string | undefined;
|
|
1121
|
+
tabIndex?: number | undefined | undefined;
|
|
1122
|
+
radioGroup?: string | undefined | undefined;
|
|
1123
1123
|
role?: React.AriaRole | undefined;
|
|
1124
|
-
about?: string | undefined;
|
|
1125
|
-
datatype?: string | undefined;
|
|
1124
|
+
about?: string | undefined | undefined;
|
|
1125
|
+
datatype?: string | undefined | undefined;
|
|
1126
1126
|
inlist?: any;
|
|
1127
|
-
property?: string | undefined;
|
|
1128
|
-
rel?: string | undefined;
|
|
1129
|
-
resource?: string | undefined;
|
|
1130
|
-
rev?: string | undefined;
|
|
1131
|
-
typeof?: string | undefined;
|
|
1132
|
-
vocab?: string | undefined;
|
|
1133
|
-
autoCapitalize?: string | undefined;
|
|
1134
|
-
autoCorrect?: string | undefined;
|
|
1135
|
-
autoSave?: string | undefined;
|
|
1136
|
-
itemProp?: string | undefined;
|
|
1137
|
-
itemScope?: boolean | undefined;
|
|
1138
|
-
itemType?: string | undefined;
|
|
1139
|
-
itemID?: string | undefined;
|
|
1140
|
-
itemRef?: string | undefined;
|
|
1141
|
-
results?: number | undefined;
|
|
1142
|
-
security?: string | undefined;
|
|
1143
|
-
unselectable?: "on" | "off" | undefined;
|
|
1144
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
1145
|
-
is?: string | undefined;
|
|
1146
|
-
"aria-activedescendant"?: string | undefined;
|
|
1127
|
+
property?: string | undefined | undefined;
|
|
1128
|
+
rel?: string | undefined | undefined;
|
|
1129
|
+
resource?: string | undefined | undefined;
|
|
1130
|
+
rev?: string | undefined | undefined;
|
|
1131
|
+
typeof?: string | undefined | undefined;
|
|
1132
|
+
vocab?: string | undefined | undefined;
|
|
1133
|
+
autoCapitalize?: string | undefined | undefined;
|
|
1134
|
+
autoCorrect?: string | undefined | undefined;
|
|
1135
|
+
autoSave?: string | undefined | undefined;
|
|
1136
|
+
itemProp?: string | undefined | undefined;
|
|
1137
|
+
itemScope?: boolean | undefined | undefined;
|
|
1138
|
+
itemType?: string | undefined | undefined;
|
|
1139
|
+
itemID?: string | undefined | undefined;
|
|
1140
|
+
itemRef?: string | undefined | undefined;
|
|
1141
|
+
results?: number | undefined | undefined;
|
|
1142
|
+
security?: string | undefined | undefined;
|
|
1143
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
1144
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
1145
|
+
is?: string | undefined | undefined;
|
|
1146
|
+
"aria-activedescendant"?: string | undefined | undefined;
|
|
1147
1147
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
1148
|
-
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
1148
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
1149
1149
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
1150
|
-
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
1151
|
-
"aria-colcount"?: number | undefined;
|
|
1152
|
-
"aria-colindex"?: number | undefined;
|
|
1153
|
-
"aria-colspan"?: number | undefined;
|
|
1154
|
-
"aria-controls"?: string | undefined;
|
|
1155
|
-
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
1156
|
-
"aria-describedby"?: string | undefined;
|
|
1157
|
-
"aria-details"?: string | undefined;
|
|
1150
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
1151
|
+
"aria-colcount"?: number | undefined | undefined;
|
|
1152
|
+
"aria-colindex"?: number | undefined | undefined;
|
|
1153
|
+
"aria-colspan"?: number | undefined | undefined;
|
|
1154
|
+
"aria-controls"?: string | undefined | undefined;
|
|
1155
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
1156
|
+
"aria-describedby"?: string | undefined | undefined;
|
|
1157
|
+
"aria-details"?: string | undefined | undefined;
|
|
1158
1158
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
1159
|
-
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
1160
|
-
"aria-errormessage"?: string | undefined;
|
|
1159
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
1160
|
+
"aria-errormessage"?: string | undefined | undefined;
|
|
1161
1161
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
1162
|
-
"aria-flowto"?: string | undefined;
|
|
1162
|
+
"aria-flowto"?: string | undefined | undefined;
|
|
1163
1163
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
1164
|
-
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
1164
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
1165
1165
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
1166
|
-
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
1167
|
-
"aria-keyshortcuts"?: string | undefined;
|
|
1168
|
-
"aria-label"?: string | undefined;
|
|
1169
|
-
"aria-labelledby"?: string | undefined;
|
|
1170
|
-
"aria-level"?: number | undefined;
|
|
1171
|
-
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
1166
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
1167
|
+
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
1168
|
+
"aria-label"?: string | undefined | undefined;
|
|
1169
|
+
"aria-labelledby"?: string | undefined | undefined;
|
|
1170
|
+
"aria-level"?: number | undefined | undefined;
|
|
1171
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
1172
1172
|
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
1173
1173
|
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
1174
1174
|
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
1175
|
-
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
1176
|
-
"aria-owns"?: string | undefined;
|
|
1177
|
-
"aria-placeholder"?: string | undefined;
|
|
1178
|
-
"aria-posinset"?: number | undefined;
|
|
1179
|
-
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
1175
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
1176
|
+
"aria-owns"?: string | undefined | undefined;
|
|
1177
|
+
"aria-placeholder"?: string | undefined | undefined;
|
|
1178
|
+
"aria-posinset"?: number | undefined | undefined;
|
|
1179
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
1180
1180
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
1181
|
-
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
1181
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
1182
1182
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
1183
|
-
"aria-roledescription"?: string | undefined;
|
|
1184
|
-
"aria-rowcount"?: number | undefined;
|
|
1185
|
-
"aria-rowindex"?: number | undefined;
|
|
1186
|
-
"aria-rowspan"?: number | undefined;
|
|
1183
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
1184
|
+
"aria-rowcount"?: number | undefined | undefined;
|
|
1185
|
+
"aria-rowindex"?: number | undefined | undefined;
|
|
1186
|
+
"aria-rowspan"?: number | undefined | undefined;
|
|
1187
1187
|
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
1188
|
-
"aria-setsize"?: number | undefined;
|
|
1189
|
-
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
1190
|
-
"aria-valuemax"?: number | undefined;
|
|
1191
|
-
"aria-valuemin"?: number | undefined;
|
|
1192
|
-
"aria-valuenow"?: number | undefined;
|
|
1193
|
-
"aria-valuetext"?: string | undefined;
|
|
1194
|
-
children?: React.ReactNode
|
|
1188
|
+
"aria-setsize"?: number | undefined | undefined;
|
|
1189
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
1190
|
+
"aria-valuemax"?: number | undefined | undefined;
|
|
1191
|
+
"aria-valuemin"?: number | undefined | undefined;
|
|
1192
|
+
"aria-valuenow"?: number | undefined | undefined;
|
|
1193
|
+
"aria-valuetext"?: string | undefined | undefined;
|
|
1194
|
+
children?: React.ReactNode;
|
|
1195
1195
|
dangerouslySetInnerHTML?: {
|
|
1196
1196
|
__html: string | TrustedHTML;
|
|
1197
|
-
} | undefined;
|
|
1197
|
+
} | undefined | undefined;
|
|
1198
1198
|
onCopy?: React.ClipboardEventHandler<HTMLLIElement> | undefined;
|
|
1199
1199
|
onCopyCapture?: React.ClipboardEventHandler<HTMLLIElement> | undefined;
|
|
1200
1200
|
onCut?: React.ClipboardEventHandler<HTMLLIElement> | undefined;
|
|
@@ -2092,9 +2092,9 @@ export declare const NavigationMenuVertical: (({ children, ...rest }: TNavigatio
|
|
|
2092
2092
|
}> | undefined;
|
|
2093
2093
|
}) => React.JSX.Element;
|
|
2094
2094
|
Item: (props: {
|
|
2095
|
-
color?: string | undefined;
|
|
2096
|
-
content?: string | undefined;
|
|
2097
|
-
translate?: "yes" | "no" | undefined;
|
|
2095
|
+
color?: string | undefined | undefined;
|
|
2096
|
+
content?: string | undefined | undefined;
|
|
2097
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
2098
2098
|
css?: import("@atom-learning/stitches-react/types/css-util").CSS<{
|
|
2099
2099
|
sm: string;
|
|
2100
2100
|
md: string;
|
|
@@ -2451,106 +2451,106 @@ export declare const NavigationMenuVertical: (({ children, ...rest }: TNavigatio
|
|
|
2451
2451
|
marginBottom: string | number | import("@atom-learning/stitches-react/types/css-util").WithScaleValue<"space">;
|
|
2452
2452
|
};
|
|
2453
2453
|
}> | undefined;
|
|
2454
|
-
prefix?: string | undefined;
|
|
2455
|
-
slot?: string | undefined;
|
|
2454
|
+
prefix?: string | undefined | undefined;
|
|
2455
|
+
slot?: string | undefined | undefined;
|
|
2456
2456
|
style?: React.CSSProperties | undefined;
|
|
2457
|
-
title?: string | undefined;
|
|
2457
|
+
title?: string | undefined | undefined;
|
|
2458
2458
|
ref?: React.Ref<HTMLLIElement> | undefined;
|
|
2459
2459
|
key?: React.Key | null | undefined;
|
|
2460
|
-
defaultChecked?: boolean | undefined;
|
|
2460
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
2461
2461
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
2462
|
-
suppressContentEditableWarning?: boolean | undefined;
|
|
2463
|
-
suppressHydrationWarning?: boolean | undefined;
|
|
2464
|
-
accessKey?: string | undefined;
|
|
2465
|
-
autoFocus?: boolean | undefined;
|
|
2466
|
-
className?: string | undefined;
|
|
2467
|
-
contentEditable?: (boolean | "true" | "false") |
|
|
2468
|
-
contextMenu?: string | undefined;
|
|
2469
|
-
dir?: string | undefined;
|
|
2462
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
2463
|
+
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
2464
|
+
accessKey?: string | undefined | undefined;
|
|
2465
|
+
autoFocus?: boolean | undefined | undefined;
|
|
2466
|
+
className?: string | undefined | undefined;
|
|
2467
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
2468
|
+
contextMenu?: string | undefined | undefined;
|
|
2469
|
+
dir?: string | undefined | undefined;
|
|
2470
2470
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
2471
|
-
hidden?: boolean | undefined;
|
|
2472
|
-
id?: string | undefined;
|
|
2473
|
-
lang?: string | undefined;
|
|
2474
|
-
nonce?: string | undefined;
|
|
2475
|
-
placeholder?: string | undefined;
|
|
2471
|
+
hidden?: boolean | undefined | undefined;
|
|
2472
|
+
id?: string | undefined | undefined;
|
|
2473
|
+
lang?: string | undefined | undefined;
|
|
2474
|
+
nonce?: string | undefined | undefined;
|
|
2475
|
+
placeholder?: string | undefined | undefined;
|
|
2476
2476
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
2477
|
-
tabIndex?: number | undefined;
|
|
2478
|
-
radioGroup?: string | undefined;
|
|
2477
|
+
tabIndex?: number | undefined | undefined;
|
|
2478
|
+
radioGroup?: string | undefined | undefined;
|
|
2479
2479
|
role?: React.AriaRole | undefined;
|
|
2480
|
-
about?: string | undefined;
|
|
2481
|
-
datatype?: string | undefined;
|
|
2480
|
+
about?: string | undefined | undefined;
|
|
2481
|
+
datatype?: string | undefined | undefined;
|
|
2482
2482
|
inlist?: any;
|
|
2483
|
-
property?: string | undefined;
|
|
2484
|
-
rel?: string | undefined;
|
|
2485
|
-
resource?: string | undefined;
|
|
2486
|
-
rev?: string | undefined;
|
|
2487
|
-
typeof?: string | undefined;
|
|
2488
|
-
vocab?: string | undefined;
|
|
2489
|
-
autoCapitalize?: string | undefined;
|
|
2490
|
-
autoCorrect?: string | undefined;
|
|
2491
|
-
autoSave?: string | undefined;
|
|
2492
|
-
itemProp?: string | undefined;
|
|
2493
|
-
itemScope?: boolean | undefined;
|
|
2494
|
-
itemType?: string | undefined;
|
|
2495
|
-
itemID?: string | undefined;
|
|
2496
|
-
itemRef?: string | undefined;
|
|
2497
|
-
results?: number | undefined;
|
|
2498
|
-
security?: string | undefined;
|
|
2499
|
-
unselectable?: "on" | "off" | undefined;
|
|
2500
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
2501
|
-
is?: string | undefined;
|
|
2502
|
-
"aria-activedescendant"?: string | undefined;
|
|
2483
|
+
property?: string | undefined | undefined;
|
|
2484
|
+
rel?: string | undefined | undefined;
|
|
2485
|
+
resource?: string | undefined | undefined;
|
|
2486
|
+
rev?: string | undefined | undefined;
|
|
2487
|
+
typeof?: string | undefined | undefined;
|
|
2488
|
+
vocab?: string | undefined | undefined;
|
|
2489
|
+
autoCapitalize?: string | undefined | undefined;
|
|
2490
|
+
autoCorrect?: string | undefined | undefined;
|
|
2491
|
+
autoSave?: string | undefined | undefined;
|
|
2492
|
+
itemProp?: string | undefined | undefined;
|
|
2493
|
+
itemScope?: boolean | undefined | undefined;
|
|
2494
|
+
itemType?: string | undefined | undefined;
|
|
2495
|
+
itemID?: string | undefined | undefined;
|
|
2496
|
+
itemRef?: string | undefined | undefined;
|
|
2497
|
+
results?: number | undefined | undefined;
|
|
2498
|
+
security?: string | undefined | undefined;
|
|
2499
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
2500
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
2501
|
+
is?: string | undefined | undefined;
|
|
2502
|
+
"aria-activedescendant"?: string | undefined | undefined;
|
|
2503
2503
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
2504
|
-
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
2504
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
2505
2505
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
2506
|
-
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
2507
|
-
"aria-colcount"?: number | undefined;
|
|
2508
|
-
"aria-colindex"?: number | undefined;
|
|
2509
|
-
"aria-colspan"?: number | undefined;
|
|
2510
|
-
"aria-controls"?: string | undefined;
|
|
2511
|
-
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
2512
|
-
"aria-describedby"?: string | undefined;
|
|
2513
|
-
"aria-details"?: string | undefined;
|
|
2506
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
2507
|
+
"aria-colcount"?: number | undefined | undefined;
|
|
2508
|
+
"aria-colindex"?: number | undefined | undefined;
|
|
2509
|
+
"aria-colspan"?: number | undefined | undefined;
|
|
2510
|
+
"aria-controls"?: string | undefined | undefined;
|
|
2511
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
2512
|
+
"aria-describedby"?: string | undefined | undefined;
|
|
2513
|
+
"aria-details"?: string | undefined | undefined;
|
|
2514
2514
|
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
2515
|
-
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
2516
|
-
"aria-errormessage"?: string | undefined;
|
|
2515
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
2516
|
+
"aria-errormessage"?: string | undefined | undefined;
|
|
2517
2517
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
2518
|
-
"aria-flowto"?: string | undefined;
|
|
2518
|
+
"aria-flowto"?: string | undefined | undefined;
|
|
2519
2519
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
2520
|
-
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
2520
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
2521
2521
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
2522
|
-
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
2523
|
-
"aria-keyshortcuts"?: string | undefined;
|
|
2524
|
-
"aria-label"?: string | undefined;
|
|
2525
|
-
"aria-labelledby"?: string | undefined;
|
|
2526
|
-
"aria-level"?: number | undefined;
|
|
2527
|
-
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
2522
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
2523
|
+
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
2524
|
+
"aria-label"?: string | undefined | undefined;
|
|
2525
|
+
"aria-labelledby"?: string | undefined | undefined;
|
|
2526
|
+
"aria-level"?: number | undefined | undefined;
|
|
2527
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
2528
2528
|
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
2529
2529
|
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
2530
2530
|
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
2531
|
-
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
2532
|
-
"aria-owns"?: string | undefined;
|
|
2533
|
-
"aria-placeholder"?: string | undefined;
|
|
2534
|
-
"aria-posinset"?: number | undefined;
|
|
2535
|
-
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
2531
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
2532
|
+
"aria-owns"?: string | undefined | undefined;
|
|
2533
|
+
"aria-placeholder"?: string | undefined | undefined;
|
|
2534
|
+
"aria-posinset"?: number | undefined | undefined;
|
|
2535
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
2536
2536
|
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
2537
|
-
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
2537
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
2538
2538
|
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
2539
|
-
"aria-roledescription"?: string | undefined;
|
|
2540
|
-
"aria-rowcount"?: number | undefined;
|
|
2541
|
-
"aria-rowindex"?: number | undefined;
|
|
2542
|
-
"aria-rowspan"?: number | undefined;
|
|
2539
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
2540
|
+
"aria-rowcount"?: number | undefined | undefined;
|
|
2541
|
+
"aria-rowindex"?: number | undefined | undefined;
|
|
2542
|
+
"aria-rowspan"?: number | undefined | undefined;
|
|
2543
2543
|
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
2544
|
-
"aria-setsize"?: number | undefined;
|
|
2545
|
-
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
2546
|
-
"aria-valuemax"?: number | undefined;
|
|
2547
|
-
"aria-valuemin"?: number | undefined;
|
|
2548
|
-
"aria-valuenow"?: number | undefined;
|
|
2549
|
-
"aria-valuetext"?: string | undefined;
|
|
2550
|
-
children?: React.ReactNode
|
|
2544
|
+
"aria-setsize"?: number | undefined | undefined;
|
|
2545
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
2546
|
+
"aria-valuemax"?: number | undefined | undefined;
|
|
2547
|
+
"aria-valuemin"?: number | undefined | undefined;
|
|
2548
|
+
"aria-valuenow"?: number | undefined | undefined;
|
|
2549
|
+
"aria-valuetext"?: string | undefined | undefined;
|
|
2550
|
+
children?: React.ReactNode;
|
|
2551
2551
|
dangerouslySetInnerHTML?: {
|
|
2552
2552
|
__html: string | TrustedHTML;
|
|
2553
|
-
} | undefined;
|
|
2553
|
+
} | undefined | undefined;
|
|
2554
2554
|
onCopy?: React.ClipboardEventHandler<HTMLLIElement> | undefined;
|
|
2555
2555
|
onCopyCapture?: React.ClipboardEventHandler<HTMLLIElement> | undefined;
|
|
2556
2556
|
onCut?: React.ClipboardEventHandler<HTMLLIElement> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type CSS } from '../../stitches';
|
|
3
3
|
export interface NumberInputProps {
|
|
4
4
|
name: string;
|
|
5
5
|
min?: number;
|
|
@@ -10,6 +10,7 @@ export interface NumberInputProps {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
readonly?: boolean;
|
|
12
12
|
size?: 'sm' | 'md' | 'lg';
|
|
13
|
+
appearance?: 'standard' | 'modern';
|
|
13
14
|
onValueChange?: (value: number) => void;
|
|
14
15
|
stepperButtonLabels?: {
|
|
15
16
|
increment?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Minus as
|
|
1
|
+
import{Minus as F,Plus as H}from"@atom-learning/icons";import*as r from"react";import{styled as $}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import"../../utilities/style/keyframe-animations.js";import{getFieldIconSize as V}from"../../utilities/style/get-icon-size.js";import{Flex as X}from"../flex/Flex.js";import{Input as _}from"../input/Input.js";import{NumberInputStepper as k}from"./NumberInputStepper.js";const G=$(X,{variants:{appearance:{standard:{},modern:{gap:"1px"}}}}),N=r.forwardRef(({value:u,defaultValue:T=0,onValueChange:w,min:n=0,max:o=Number.MAX_SAFE_INTEGER,step:m=1,disabled:s=!1,readonly:p=!1,size:x="md",stepperButtonLabels:A,disabledTooltipContent:I,css:M,appearance:d="standard",...z},L)=>{const[a,E]=r.useState(u||T);r.useEffect(()=>{typeof u<"u"&&E(u)},[u]);const l=r.useRef(null);r.useImperativeHandle(L,()=>l.current);const R=r.useMemo(()=>V(x),[x]),h={increment:"increment",decrement:"decrement",...A},y={decrement:`Cannot enter values below ${n}`,increment:`Cannot enter values above ${o}`,...I},c=a>=o,b=a<=n,f=r.useCallback(e=>Math.min(Math.max(e,n),o),[o,n]),t=r.useCallback(e=>{w==null||w(e),E(e)},[w]),B=r.useCallback(e=>{const i=Number(e.target.value.replace(/\D/g,""));t(i)},[t]),v=r.useCallback(()=>{var e;if(c||p)return;(e=l==null?void 0:l.current)==null||e.focus();const i=Number(a)+m;t(f(i))},[f,c,p,m,t,a]),C=r.useCallback(()=>{var e;if(b||p)return;(e=l==null?void 0:l.current)==null||e.focus();const i=Number(a)-m;t(f(i))},[f,b,p,n,m,t,a]),D=r.useCallback(e=>{if(e.nativeEvent.isComposing)return;const i=e.key,g={ArrowUp:v,ArrowRight:v,ArrowDown:C,ArrowLeft:C,Home:()=>t(n),End:()=>t(o)}[i];g&&(e.preventDefault(),g(e))},[v,C,t,n,o]),S={type:"number",value:a,...z,onChange:B,onKeyDown:D,size:x,appearance:d,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:l,readOnly:p,disabled:s,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":a,role:"spinbutton"};return r.createElement(G,{appearance:d,css:M},r.createElement(k,{onClick:C,icon:F,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:R,fieldAppearance:d,disabled:b||s,showTooltip:b&&!s,disabledTooltipContent:y.decrement,label:h.decrement}),r.createElement(_,{...S}),r.createElement(k,{onClick:v,icon:H,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:R,fieldAppearance:d,disabled:c||s,showTooltip:c&&!s,disabledTooltipContent:y.increment,label:h.increment}))});N.displayName="NumberInput";export{N as NumberInput};
|
|
2
2
|
//# sourceMappingURL=NumberInput.js.map
|