@pantool/components 1.0.0-alpha.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/README.md +80 -0
- package/dist/atoms/alert-dialog/alert-dialog.d.ts +7 -0
- package/dist/atoms/alert-dialog/alert-dialog.js +2 -0
- package/dist/atoms/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/atoms/alert-dialog/index.d.ts +1 -0
- package/dist/atoms/alert-dialog/index.js +1 -0
- package/dist/atoms/button/button.css +18 -0
- package/dist/atoms/button/button.d.ts +16 -0
- package/dist/atoms/button/button.js +2 -0
- package/dist/atoms/button/button.js.map +1 -0
- package/dist/atoms/button/button.module.js +2 -0
- package/dist/atoms/button/button.module.js.map +1 -0
- package/dist/atoms/button/index.d.ts +1 -0
- package/dist/atoms/button/index.js +1 -0
- package/dist/atoms/checkbox/checkbox.css +119 -0
- package/dist/atoms/checkbox/checkbox.d.ts +53 -0
- package/dist/atoms/checkbox/checkbox.js +2 -0
- package/dist/atoms/checkbox/checkbox.js.map +1 -0
- package/dist/atoms/checkbox/checkbox.module.js +2 -0
- package/dist/atoms/checkbox/checkbox.module.js.map +1 -0
- package/dist/atoms/checkbox/index.d.ts +1 -0
- package/dist/atoms/checkbox/index.js +1 -0
- package/dist/atoms/combobox/combobox.css +302 -0
- package/dist/atoms/combobox/combobox.d.ts +115 -0
- package/dist/atoms/combobox/combobox.js +2 -0
- package/dist/atoms/combobox/combobox.js.map +1 -0
- package/dist/atoms/combobox/combobox.module.js +2 -0
- package/dist/atoms/combobox/combobox.module.js.map +1 -0
- package/dist/atoms/combobox/components/chip.js +2 -0
- package/dist/atoms/combobox/components/chip.js.map +1 -0
- package/dist/atoms/combobox/components/item.d.ts +17 -0
- package/dist/atoms/combobox/components/item.js +2 -0
- package/dist/atoms/combobox/components/item.js.map +1 -0
- package/dist/atoms/combobox/index.d.ts +1 -0
- package/dist/atoms/combobox/index.js +1 -0
- package/dist/atoms/condition-guard/condition-guard.d.ts +32 -0
- package/dist/atoms/condition-guard/condition-guard.js +2 -0
- package/dist/atoms/condition-guard/condition-guard.js.map +1 -0
- package/dist/atoms/condition-guard/index.js +1 -0
- package/dist/atoms/context-menu/context-menu.css +75 -0
- package/dist/atoms/context-menu/context-menu.d.ts +41 -0
- package/dist/atoms/context-menu/context-menu.js +2 -0
- package/dist/atoms/context-menu/context-menu.js.map +1 -0
- package/dist/atoms/context-menu/context-menu.module.js +2 -0
- package/dist/atoms/context-menu/context-menu.module.js.map +1 -0
- package/dist/atoms/context-menu/index.js +1 -0
- package/dist/atoms/dialog/dialog.d.ts +7 -0
- package/dist/atoms/dialog/dialog.js +2 -0
- package/dist/atoms/dialog/dialog.js.map +1 -0
- package/dist/atoms/dialog/index.d.ts +1 -0
- package/dist/atoms/dialog/index.js +1 -0
- package/dist/atoms/icon/icon.d.ts +14 -0
- package/dist/atoms/icon/icon.js +2 -0
- package/dist/atoms/icon/icon.js.map +1 -0
- package/dist/atoms/icon/index.d.ts +1 -0
- package/dist/atoms/icon/index.js +1 -0
- package/dist/atoms/icon-button/icon-button.css +12 -0
- package/dist/atoms/icon-button/icon-button.d.ts +14 -0
- package/dist/atoms/icon-button/icon-button.js +2 -0
- package/dist/atoms/icon-button/icon-button.js.map +1 -0
- package/dist/atoms/icon-button/icon-button.module.js +2 -0
- package/dist/atoms/icon-button/icon-button.module.js.map +1 -0
- package/dist/atoms/icon-button/index.d.ts +1 -0
- package/dist/atoms/icon-button/index.js +1 -0
- package/dist/atoms/index.d.ts +17 -0
- package/dist/atoms/index.js +1 -0
- package/dist/atoms/input/index.d.ts +1 -0
- package/dist/atoms/input/index.js +1 -0
- package/dist/atoms/input/input.css +29 -0
- package/dist/atoms/input/input.d.ts +39 -0
- package/dist/atoms/input/input.js +2 -0
- package/dist/atoms/input/input.js.map +1 -0
- package/dist/atoms/input/input.module.js +2 -0
- package/dist/atoms/input/input.module.js.map +1 -0
- package/dist/atoms/radio/index.d.ts +1 -0
- package/dist/atoms/radio/index.js +1 -0
- package/dist/atoms/radio/radio.css +142 -0
- package/dist/atoms/radio/radio.d.ts +40 -0
- package/dist/atoms/radio/radio.js +2 -0
- package/dist/atoms/radio/radio.js.map +1 -0
- package/dist/atoms/radio/radio.module.js +2 -0
- package/dist/atoms/radio/radio.module.js.map +1 -0
- package/dist/atoms/switch/index.d.ts +1 -0
- package/dist/atoms/switch/index.js +1 -0
- package/dist/atoms/switch/switch.css +68 -0
- package/dist/atoms/switch/switch.d.ts +19 -0
- package/dist/atoms/switch/switch.js +2 -0
- package/dist/atoms/switch/switch.js.map +1 -0
- package/dist/atoms/switch/switch.module.js +2 -0
- package/dist/atoms/switch/switch.module.js.map +1 -0
- package/dist/atoms/tabs/index.d.ts +3 -0
- package/dist/atoms/tabs/index.js +1 -0
- package/dist/atoms/tabs/tabs.css +92 -0
- package/dist/atoms/tabs/tabs.d.ts +43 -0
- package/dist/atoms/tabs/tabs.js +2 -0
- package/dist/atoms/tabs/tabs.js.map +1 -0
- package/dist/atoms/tabs/tabs.module.js +2 -0
- package/dist/atoms/tabs/tabs.module.js.map +1 -0
- package/dist/atoms/text/index.d.ts +1 -0
- package/dist/atoms/text/index.js +1 -0
- package/dist/atoms/text/text.css +273 -0
- package/dist/atoms/text/text.d.ts +18 -0
- package/dist/atoms/text/text.js +2 -0
- package/dist/atoms/text/text.js.map +1 -0
- package/dist/atoms/text/text.module.js +2 -0
- package/dist/atoms/text/text.module.js.map +1 -0
- package/dist/atoms/toast/index.d.ts +1 -0
- package/dist/atoms/toast/index.js +1 -0
- package/dist/atoms/toast/toast.css +151 -0
- package/dist/atoms/toast/toast.d.ts +11 -0
- package/dist/atoms/toast/toast.js +2 -0
- package/dist/atoms/toast/toast.js.map +1 -0
- package/dist/atoms/toast/toast.module.js +2 -0
- package/dist/atoms/toast/toast.module.js.map +1 -0
- package/dist/atoms/tooltip/index.d.ts +1 -0
- package/dist/atoms/tooltip/index.js +1 -0
- package/dist/atoms/tooltip/tooltip.css +92 -0
- package/dist/atoms/tooltip/tooltip.d.ts +50 -0
- package/dist/atoms/tooltip/tooltip.js +2 -0
- package/dist/atoms/tooltip/tooltip.js.map +1 -0
- package/dist/atoms/tooltip/tooltip.module.js +2 -0
- package/dist/atoms/tooltip/tooltip.module.js.map +1 -0
- package/dist/helpers/portal/context/hooks.d.ts +7 -0
- package/dist/helpers/portal/context/hooks.js +2 -0
- package/dist/helpers/portal/context/hooks.js.map +1 -0
- package/dist/helpers/portal/context/index.internal.d.ts +2 -0
- package/dist/helpers/portal/context/index.internal.js +1 -0
- package/dist/helpers/portal/context/portal-config.d.ts +12 -0
- package/dist/helpers/portal/context/portal-config.js +2 -0
- package/dist/helpers/portal/context/portal-config.js.map +1 -0
- package/dist/helpers/portal/context/provider.d.ts +11 -0
- package/dist/helpers/portal/context/provider.js +2 -0
- package/dist/helpers/portal/context/provider.js.map +1 -0
- package/dist/helpers/portal/index.d.ts +3 -0
- package/dist/helpers/portal/index.js +1 -0
- package/dist/helpers/portal/portal.d.ts +24 -0
- package/dist/helpers/portal/portal.js +2 -0
- package/dist/helpers/portal/portal.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +1 -0
- package/dist/internals/base-button/base-button.css +262 -0
- package/dist/internals/base-button/base-button.d.ts +19 -0
- package/dist/internals/base-button/base-button.js +2 -0
- package/dist/internals/base-button/base-button.js.map +1 -0
- package/dist/internals/base-button/base-button.module.js +2 -0
- package/dist/internals/base-button/base-button.module.js.map +1 -0
- package/dist/internals/base-button/index.d.ts +1 -0
- package/dist/internals/base-button/index.js +1 -0
- package/dist/internals/base-dialog/base-dialog.css +74 -0
- package/dist/internals/base-dialog/base-dialog.d.ts +40 -0
- package/dist/internals/base-dialog/base-dialog.js +2 -0
- package/dist/internals/base-dialog/base-dialog.js.map +1 -0
- package/dist/internals/base-dialog/base-dialog.module.js +2 -0
- package/dist/internals/base-dialog/base-dialog.module.js.map +1 -0
- package/dist/internals/base-dialog/index.d.ts +1 -0
- package/dist/internals/base-dialog/index.js +1 -0
- package/dist/internals/base-field/base-field.css +115 -0
- package/dist/internals/base-field/base-field.d.ts +75 -0
- package/dist/internals/base-field/base-field.js +2 -0
- package/dist/internals/base-field/base-field.js.map +1 -0
- package/dist/internals/base-field/base-field.module.js +2 -0
- package/dist/internals/base-field/base-field.module.js.map +1 -0
- package/dist/internals/base-field/components/description.js +2 -0
- package/dist/internals/base-field/components/description.js.map +1 -0
- package/dist/internals/base-field/components/error.js +2 -0
- package/dist/internals/base-field/components/error.js.map +1 -0
- package/dist/internals/base-field/components/label.js +2 -0
- package/dist/internals/base-field/components/label.js.map +1 -0
- package/dist/internals/base-field/index.d.ts +1 -0
- package/dist/internals/base-field/index.js +1 -0
- package/dist/internals/base-svg/base-svg.css +137 -0
- package/dist/internals/base-svg/base-svg.d.ts +29 -0
- package/dist/internals/base-svg/base-svg.js +2 -0
- package/dist/internals/base-svg/base-svg.js.map +1 -0
- package/dist/internals/base-svg/base-svg.module.js +2 -0
- package/dist/internals/base-svg/base-svg.module.js.map +1 -0
- package/dist/internals/base-svg/index.d.ts +1 -0
- package/dist/internals/base-svg/index.js +1 -0
- package/dist/providers/alert-dialog-provider/alert-dialog-provider.d.ts +43 -0
- package/dist/providers/alert-dialog-provider/alert-dialog-provider.js +2 -0
- package/dist/providers/alert-dialog-provider/alert-dialog-provider.js.map +1 -0
- package/dist/providers/alert-dialog-provider/hooks.d.ts +16 -0
- package/dist/providers/alert-dialog-provider/hooks.js +2 -0
- package/dist/providers/alert-dialog-provider/hooks.js.map +1 -0
- package/dist/providers/alert-dialog-provider/index.d.ts +2 -0
- package/dist/providers/alert-dialog-provider/index.js +1 -0
- package/dist/providers/dialog-provider/dialog-provider.d.ts +43 -0
- package/dist/providers/dialog-provider/dialog-provider.js +2 -0
- package/dist/providers/dialog-provider/dialog-provider.js.map +1 -0
- package/dist/providers/dialog-provider/hooks.d.ts +16 -0
- package/dist/providers/dialog-provider/hooks.js +2 -0
- package/dist/providers/dialog-provider/hooks.js.map +1 -0
- package/dist/providers/dialog-provider/index.d.ts +2 -0
- package/dist/providers/dialog-provider/index.js +1 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/index.js +1 -0
- package/dist/providers/toast-provider/index.d.ts +1 -0
- package/dist/providers/toast-provider/index.js +1 -0
- package/dist/providers/toast-provider/toast-provider.css +13 -0
- package/dist/providers/toast-provider/toast-provider.d.ts +124 -0
- package/dist/providers/toast-provider/toast-provider.js +2 -0
- package/dist/providers/toast-provider/toast-provider.js.map +1 -0
- package/dist/providers/toast-provider/toast-provider.module.js +2 -0
- package/dist/providers/toast-provider/toast-provider.module.js.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.js +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FieldProps } from "../../internals/base-field/base-field.js";
|
|
2
|
+
import { InputProps } from "@base-ui/react/input";
|
|
3
|
+
|
|
4
|
+
//#region src/atoms/input/input.d.ts
|
|
5
|
+
type InputProps$1 = Omit<InputProps, "size" | "className"> & Pick<FieldProps, "label" | "hideLabel" | "name" | "required" | "description" | "invalid" | "errorText" | "dirty" | "size" | "disabled" | "autoFocus"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Additional CSS classes for styling.
|
|
8
|
+
*/
|
|
9
|
+
classNames?: {
|
|
10
|
+
root?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
control?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* An input component with built-in labeling, validation, and theming.
|
|
19
|
+
* Built on top of Base UI's Input component and the internal Field component.
|
|
20
|
+
*/
|
|
21
|
+
declare function Input$1({
|
|
22
|
+
label,
|
|
23
|
+
hideLabel,
|
|
24
|
+
size,
|
|
25
|
+
disabled,
|
|
26
|
+
required,
|
|
27
|
+
name,
|
|
28
|
+
description,
|
|
29
|
+
invalid,
|
|
30
|
+
errorText,
|
|
31
|
+
dirty,
|
|
32
|
+
readOnly,
|
|
33
|
+
autoFocus,
|
|
34
|
+
classNames,
|
|
35
|
+
...props
|
|
36
|
+
}: InputProps$1): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Input$1 as Input, InputProps$1 as InputProps };
|
|
39
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Field as e}from"../../internals/base-field/base-field.js";import"../../internals/base-field/index.js";import t from"./input.module.js";import n from"clsx";import{jsx as r}from"react/jsx-runtime";import{Input as i}from"@base-ui/react/input";function a({label:a,hideLabel:o=!1,size:s=`md`,disabled:c=!1,required:l=!1,name:u,description:d,invalid:f,errorText:p,dirty:m,readOnly:h,autoFocus:g,classNames:_,...v}){return r(e,{label:a,hideLabel:o,size:s,disabled:c,required:l,errorText:p,invalid:f,description:d,classNames:{root:_?.root,label:_?.label,description:_?.description,error:_?.error},"data-slot":`input-root`,children:r(i,{disabled:c,required:l,readOnly:h,"data-slot":`input-control`,className:n(t.control,_?.control),...v})})}export{a as Input};
|
|
2
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","names":["Input","BaseInput","styles"],"sources":["../../../src/atoms/input/input.tsx"],"sourcesContent":["import {\n Input as BaseInput,\n type InputProps as BaseInputProps,\n} from \"@base-ui/react/input\";\nimport { Field, type FieldProps } from \"../../internals/base-field\";\nimport clsx from \"clsx\";\nimport styles from \"./input.module.css\";\n\nexport type InputProps = Omit<BaseInputProps, \"size\" | \"className\"> &\n Pick<\n FieldProps,\n | \"label\"\n | \"hideLabel\"\n | \"name\"\n | \"required\"\n | \"description\"\n | \"invalid\"\n | \"errorText\"\n | \"dirty\"\n | \"size\"\n | \"disabled\"\n | \"autoFocus\"\n > & {\n /**\n * Additional CSS classes for styling.\n */\n classNames?: {\n root?: string;\n label?: string;\n description?: string;\n error?: string;\n control?: string;\n };\n };\n\n/**\n * An input component with built-in labeling, validation, and theming.\n * Built on top of Base UI's Input component and the internal Field component.\n */\nexport function Input({\n label,\n hideLabel = false,\n size = \"md\",\n disabled = false,\n required = false,\n name,\n description,\n invalid,\n errorText,\n dirty,\n readOnly,\n autoFocus,\n classNames,\n ...props\n}: InputProps) {\n return (\n <Field\n label={label}\n hideLabel={hideLabel}\n size={size}\n disabled={disabled}\n required={required}\n errorText={errorText}\n invalid={invalid}\n description={description}\n classNames={{\n root: classNames?.root,\n label: classNames?.label,\n description: classNames?.description,\n error: classNames?.error,\n }}\n data-slot=\"input-root\"\n >\n <BaseInput\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n data-slot=\"input-control\"\n className={clsx(styles[\"control\"], classNames?.control)}\n {...props}\n />\n </Field>\n );\n}\n"],"mappings":"uPAuCA,SAAgBA,EAAM,CACpB,QACA,YAAY,GACZ,OAAO,KACP,WAAW,GACX,WAAW,GACX,OACA,cACA,UACA,YACA,QACA,WACA,YACA,aACA,GAAG,GACU,CACb,OACE,EAAC,EAAD,CACS,QACI,YACL,OACI,WACA,WACC,YACF,UACI,cACb,WAAY,CACV,KAAM,GAAY,KAClB,MAAO,GAAY,MACnB,YAAa,GAAY,YACzB,MAAO,GAAY,KACrB,EACA,YAAU,sBAEV,EAACC,EAAD,CACY,WACA,WACA,WACV,YAAU,gBACV,UAAW,EAAKC,EAAO,QAAY,GAAY,OAAO,EACtD,GAAI,CACL,CAAA,CACI,CAAA,CAEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.module.js","names":[],"sources":["../../../src/atoms/input/input.module.css"],"sourcesContent":[".control {\n box-sizing: border-box;\n padding: 0 var(--spacing-sm);\n margin: 0;\n border-radius: var(--field-control-radius);\n border: 1px solid var(--field-control-border-color);\n width: 100%;\n height: var(--field-control-height);\n font-family: inherit;\n font-size: var(--field-control-font-size, var(--typography-body-2-size));\n line-height: var(\n --field-control-line-height,\n var(--typography-body-2-height)\n );\n font-weight: var(\n --field-control-font-weight,\n var(--typography-body-2-weight)\n );\n background-color: var(--field-control-bg-color);\n color: var(--field-control-text-color);\n transition: border-color 0.2s ease-in-out;\n font-family: var(--typography-typeface-ltr);\n\n &::placeholder {\n color: var(--field-control-placeholder-color);\n font-family: var(--typography-typeface-ltr);\n }\n\n &:focus-visible {\n outline-style: solid;\n outline-width: var(--stroke-focus-ring);\n outline-color: var(--color-action-info-base);\n outline-offset: var(--spacing-xxs);\n }\n}\n"],"mappings":"AAEA,IAAA,EAAa,CAAG,QAAU,gBAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Radio, RadioGroup, RadioGroupProps, RadioProps } from "./radio.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./radio.js";
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
.FLTLnW_group {
|
|
2
|
+
gap: var(--spacing-xs);
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.FLTLnW_group[data-disabled] {
|
|
8
|
+
cursor: not-allowed;
|
|
9
|
+
opacity: .5;
|
|
10
|
+
|
|
11
|
+
& * {
|
|
12
|
+
cursor: not-allowed;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.FLTLnW_root {
|
|
17
|
+
--radio-size: 1rem;
|
|
18
|
+
--radio-bg: transparent;
|
|
19
|
+
--radio-border: var(--color-border-primary);
|
|
20
|
+
--radio-dot-color: transparent;
|
|
21
|
+
--radio-gap: var(--spacing-xs);
|
|
22
|
+
--radio-label-color: var(--color-content-neutral-base);
|
|
23
|
+
font-family: var(--typography-typeface-ltr);
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: var(--radio-gap);
|
|
26
|
+
display: flex;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.FLTLnW_control {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
width: var(--radio-size);
|
|
33
|
+
height: var(--radio-size);
|
|
34
|
+
background-color: var(--radio-bg);
|
|
35
|
+
box-shadow: 0 0 0 1px var(--radio-border) inset;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
border: none;
|
|
38
|
+
border-radius: 9999px;
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
padding: 0;
|
|
43
|
+
transition: background-color .2s, box-shadow .2s;
|
|
44
|
+
display: flex;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.FLTLnW_root[data-size="sm"] {
|
|
48
|
+
--radio-size: .875rem;
|
|
49
|
+
--radio-gap: var(--spacing-xs);
|
|
50
|
+
--radio-label-font-size: var(--typography-body-2-size);
|
|
51
|
+
--radio-label-line-height: var(--typography-body-2-height);
|
|
52
|
+
--radio-label-font-weight: var(--typography-body-2-weight);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.FLTLnW_root[data-size="md"], .FLTLnW_root:not([data-size]) {
|
|
56
|
+
--radio-size: 1rem;
|
|
57
|
+
--radio-gap: var(--spacing-xs);
|
|
58
|
+
--radio-label-font-size: var(--typography-body-1-size);
|
|
59
|
+
--radio-label-line-height: var(--typography-body-1-height);
|
|
60
|
+
--radio-label-font-weight: var(--typography-body-1-weight);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.FLTLnW_root[data-size="lg"] {
|
|
64
|
+
--radio-size: 1.25rem;
|
|
65
|
+
--radio-gap: var(--spacing-sm);
|
|
66
|
+
--radio-label-font-size: var(--typography-body-1-size);
|
|
67
|
+
--radio-label-line-height: var(--typography-body-1-height);
|
|
68
|
+
--radio-label-font-weight: var(--typography-body-1-weight);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.FLTLnW_control[data-checked]:not([data-invalid]) {
|
|
72
|
+
--radio-bg: var(--color-action-neutral-base);
|
|
73
|
+
--radio-border: transparent;
|
|
74
|
+
--radio-dot-color: var(--color-on-neutral);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.FLTLnW_control:focus-visible {
|
|
78
|
+
outline-style: solid;
|
|
79
|
+
outline-width: var(--stroke-focus-ring);
|
|
80
|
+
outline-color: var(--color-action-info-base);
|
|
81
|
+
outline-offset: var(--spacing-xxs);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.FLTLnW_root[data-disabled] {
|
|
85
|
+
cursor: not-allowed;
|
|
86
|
+
opacity: .5;
|
|
87
|
+
|
|
88
|
+
& * {
|
|
89
|
+
cursor: not-allowed;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.FLTLnW_root[data-invalid] {
|
|
94
|
+
--radio-border: var(--color-negative);
|
|
95
|
+
--radio-label-color: var(--color-content-negative-base);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.FLTLnW_control[data-invalid][data-checked] {
|
|
99
|
+
--radio-bg: var(--color-negative);
|
|
100
|
+
--radio-dot-color: var(--color-on-negative);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.FLTLnW_indicator {
|
|
104
|
+
justify-content: center;
|
|
105
|
+
align-items: center;
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 100%;
|
|
108
|
+
display: flex;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.FLTLnW_indicator[data-unchecked] {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.FLTLnW_indicator:before {
|
|
116
|
+
content: "";
|
|
117
|
+
background-color: var(--radio-dot-color);
|
|
118
|
+
border-radius: 9999px;
|
|
119
|
+
width: 45%;
|
|
120
|
+
height: 45%;
|
|
121
|
+
transition: background-color .2s;
|
|
122
|
+
display: block;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.FLTLnW_label {
|
|
126
|
+
font-size: var(--radio-label-font-size, var(--typography-body-2-size));
|
|
127
|
+
line-height: var(--radio-label-line-height, var(--typography-body-2-height));
|
|
128
|
+
font-weight: var(--radio-label-font-weight, var(--typography-body-2-weight));
|
|
129
|
+
color: var(--radio-label-color);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.FLTLnW_label--hidden {
|
|
133
|
+
clip: rect(0, 0, 0, 0);
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
border: 0;
|
|
136
|
+
width: 1px;
|
|
137
|
+
height: 1px;
|
|
138
|
+
margin: -1px;
|
|
139
|
+
padding: 0;
|
|
140
|
+
position: absolute;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RadioRootProps } from "@base-ui/react/radio";
|
|
2
|
+
import { RadioGroupProps } from "@base-ui/react/radio-group";
|
|
3
|
+
|
|
4
|
+
//#region src/atoms/radio/radio.d.ts
|
|
5
|
+
type RadioGroupProps$1 = Omit<RadioGroupProps, "className"> & {
|
|
6
|
+
/** The size applied to all child Radio items. @default "md" */size?: "sm" | "md" | "lg";
|
|
7
|
+
/**
|
|
8
|
+
* Gets or sets whether or not the group is in a visually invalid state.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
invalid?: boolean; /** Additional CSS classes for styling. */
|
|
12
|
+
classNames?: {
|
|
13
|
+
root?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
declare const RadioGroup$1: (props: RadioGroupProps$1) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type RadioProps = Omit<RadioRootProps, "className"> & {
|
|
18
|
+
/** The size of the radio button. Inherited from RadioGroup if not set. @default "md" */size?: "sm" | "md" | "lg"; /** The text label accompanying the radio button. */
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Visually hides the label but keeps it accessible to screen readers.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
hideLabel?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Gets or sets whether or not the radio is in a visually invalid state.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
invalid?: boolean; /** Additional CSS classes for styling. */
|
|
30
|
+
classNames?: {
|
|
31
|
+
root?: string;
|
|
32
|
+
control?: string;
|
|
33
|
+
indicator?: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
declare const Radio$1: (props: RadioProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { Radio$1 as Radio, RadioGroup$1 as RadioGroup, RadioGroupProps$1 as RadioGroupProps, RadioProps };
|
|
40
|
+
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"./radio.module.js";import t from"clsx";import{useId as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{Radio as a}from"@base-ui/react/radio";import{RadioGroup as o}from"@base-ui/react/radio-group";const s=n=>{let{size:i=`md`,invalid:a,disabled:s=!1,required:c=!1,classNames:l,children:u,...d}=n;return r(o,{...d,disabled:s,required:c,"data-size":i,"data-invalid":a||void 0,"data-disabled":s||void 0,"data-required":c||void 0,className:t(e.group,l?.root),"data-slot":`radio-group`,children:u})},c=o=>{let{size:s,label:c,hideLabel:l=!1,disabled:u=!1,required:d=!1,invalid:f,readOnly:p,classNames:m,...h}=o,g=n();return i(`div`,{"data-size":s,"data-disabled":u||void 0,"data-required":d||void 0,"data-invalid":f||void 0,className:t(e.root,m?.root),"data-slot":`radio-root`,children:[r(a.Root,{...h,disabled:u,required:d,readOnly:p,"data-invalid":f||void 0,className:t(e.control,m?.control),"data-slot":`radio-control`,id:g,children:r(a.Indicator,{"data-slot":`radio-indicator`,className:t(e.indicator,m?.indicator)})}),r(`label`,{htmlFor:g,className:t(e.label,l&&e[`label--hidden`],m?.label),"data-slot":`radio-label`,children:c})]})};export{c as Radio,s as RadioGroup};
|
|
2
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","names":["RadioGroup","BaseUIRadioGroup","styles","Radio","BaseUIRadio"],"sources":["../../../src/atoms/radio/radio.tsx"],"sourcesContent":["import {\n Radio as BaseUIRadio,\n type RadioRootProps,\n} from \"@base-ui/react/radio\";\nimport {\n RadioGroup as BaseUIRadioGroup,\n type RadioGroupProps as BaseUIRadioGroupProps,\n} from \"@base-ui/react/radio-group\";\nimport styles from \"./radio.module.css\";\nimport clsx from \"clsx\";\nimport { useId } from \"react\";\n\n// ─── RadioGroup ───────────────────────────────────────────────────────────────\n\nexport type RadioGroupProps = Omit<BaseUIRadioGroupProps, \"className\"> & {\n /** The size applied to all child Radio items. @default \"md\" */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Gets or sets whether or not the group is in a visually invalid state.\n * @default false\n */\n invalid?: boolean;\n /** Additional CSS classes for styling. */\n classNames?: {\n root?: string;\n };\n};\n\nexport const RadioGroup = (props: RadioGroupProps) => {\n const {\n size = \"md\",\n invalid,\n disabled = false,\n required = false,\n classNames,\n children,\n ...otherProps\n } = props;\n\n return (\n <BaseUIRadioGroup\n {...otherProps}\n disabled={disabled}\n required={required}\n data-size={size}\n data-invalid={invalid || undefined}\n data-disabled={disabled || undefined}\n data-required={required || undefined}\n className={clsx(styles[\"group\"], classNames?.root)}\n data-slot=\"radio-group\"\n >\n {children}\n </BaseUIRadioGroup>\n );\n};\n\n// ─── Radio ────────────────────────────────────────────────────────────────────\n\nexport type RadioProps = Omit<RadioRootProps, \"className\"> & {\n /** The size of the radio button. Inherited from RadioGroup if not set. @default \"md\" */\n size?: \"sm\" | \"md\" | \"lg\";\n /** The text label accompanying the radio button. */\n label: string;\n /**\n * Visually hides the label but keeps it accessible to screen readers.\n * @default false\n */\n hideLabel?: boolean;\n /**\n * Gets or sets whether or not the radio is in a visually invalid state.\n * @default false\n */\n invalid?: boolean;\n /** Additional CSS classes for styling. */\n classNames?: {\n root?: string;\n control?: string;\n indicator?: string;\n label?: string;\n };\n};\n\nexport const Radio = (props: RadioProps) => {\n const {\n size,\n label,\n hideLabel = false,\n disabled = false,\n required = false,\n invalid,\n readOnly,\n classNames,\n ...otherProps\n } = props;\n\n const id = useId();\n\n return (\n <div\n data-size={size}\n data-disabled={disabled || undefined}\n data-required={required || undefined}\n data-invalid={invalid || undefined}\n className={clsx(styles[\"root\"], classNames?.root)}\n data-slot=\"radio-root\"\n >\n <BaseUIRadio.Root\n {...otherProps}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n data-invalid={invalid || undefined}\n className={clsx(styles[\"control\"], classNames?.control)}\n data-slot=\"radio-control\"\n id={id}\n >\n <BaseUIRadio.Indicator\n data-slot=\"radio-indicator\"\n className={clsx(styles[\"indicator\"], classNames?.indicator)}\n />\n </BaseUIRadio.Root>\n\n <label\n htmlFor={id}\n className={clsx(\n styles[\"label\"],\n hideLabel && styles[\"label--hidden\"],\n classNames?.label,\n )}\n data-slot=\"radio-label\"\n >\n {label}\n </label>\n </div>\n );\n};\n"],"mappings":"0OA4BA,MAAaA,EAAc,GAA2B,CACpD,GAAM,CACJ,OAAO,KACP,UACA,WAAW,GACX,WAAW,GACX,aACA,WACA,GAAG,GACD,EAEJ,OACE,EAACC,EAAD,CACE,GAAI,EACM,WACA,WACV,YAAW,EACX,eAAc,GAAW,IAAA,GACzB,gBAAe,GAAY,IAAA,GAC3B,gBAAe,GAAY,IAAA,GAC3B,UAAW,EAAKC,EAAO,MAAU,GAAY,IAAI,EACjD,YAAU,cAET,UACe,CAAA,CAEtB,EA4BaC,EAAS,GAAsB,CAC1C,GAAM,CACJ,OACA,QACA,YAAY,GACZ,WAAW,GACX,WAAW,GACX,UACA,WACA,aACA,GAAG,GACD,EAEE,EAAK,EAAM,EAEjB,OACE,EAAC,MAAD,CACE,YAAW,EACX,gBAAe,GAAY,IAAA,GAC3B,gBAAe,GAAY,IAAA,GAC3B,eAAc,GAAW,IAAA,GACzB,UAAW,EAAKD,EAAO,KAAS,GAAY,IAAI,EAChD,YAAU,sBANZ,CAQE,EAACE,EAAY,KAAb,CACE,GAAI,EACM,WACA,WACA,WACV,eAAc,GAAW,IAAA,GACzB,UAAW,EAAKF,EAAO,QAAY,GAAY,OAAO,EACtD,YAAU,gBACN,cAEJ,EAACE,EAAY,UAAb,CACE,YAAU,kBACV,UAAW,EAAKF,EAAO,UAAc,GAAY,SAAS,CAC3D,CAAA,CACe,CAAA,EAElB,EAAC,QAAD,CACE,QAAS,EACT,UAAW,EACTA,EAAO,MACP,GAAaA,EAAO,iBACpB,GAAY,KACd,EACA,YAAU,uBAET,CACI,CAAA,CACJ,GAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.module.js","names":[],"sources":["../../../src/atoms/radio/radio.module.css"],"sourcesContent":["/* ─── RadioGroup ─────────────────────────────────────────────────────────────── */\n\n.group {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-xs);\n}\n\n.group[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n & * {\n cursor: not-allowed;\n }\n}\n\n/* ─── Radio Item ─────────────────────────────────────────────────────────────── */\n\n.root {\n --radio-size: 1rem;\n --radio-bg: transparent;\n --radio-border: var(--color-border-primary);\n --radio-dot-color: transparent;\n --radio-gap: var(--spacing-xs);\n --radio-label-color: var(--color-content-neutral-base);\n font-family: var(--typography-typeface-ltr);\n display: flex;\n align-items: center;\n position: relative;\n gap: var(--radio-gap);\n}\n\n.control {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--radio-size);\n height: var(--radio-size);\n background-color: var(--radio-bg);\n box-shadow: 0 0 0 1px var(--radio-border) inset;\n border-radius: 9999px;\n border: none;\n cursor: pointer;\n padding: 0;\n transition:\n background-color 0.2s,\n box-shadow 0.2s;\n}\n\n/* Sizes — mirrors Checkbox sizing tokens */\n\n.root[data-size=\"sm\"] {\n --radio-size: 0.875rem;\n --radio-gap: var(--spacing-xs);\n --radio-label-font-size: var(--typography-body-2-size);\n --radio-label-line-height: var(--typography-body-2-height);\n --radio-label-font-weight: var(--typography-body-2-weight);\n}\n\n.root[data-size=\"md\"],\n.root:not([data-size]) {\n --radio-size: 1rem;\n --radio-gap: var(--spacing-xs);\n --radio-label-font-size: var(--typography-body-1-size);\n --radio-label-line-height: var(--typography-body-1-height);\n --radio-label-font-weight: var(--typography-body-1-weight);\n}\n\n.root[data-size=\"lg\"] {\n --radio-size: 1.25rem;\n --radio-gap: var(--spacing-sm);\n --radio-label-font-size: var(--typography-body-1-size);\n --radio-label-line-height: var(--typography-body-1-height);\n --radio-label-font-weight: var(--typography-body-1-weight);\n}\n\n/* Checked state */\n\n.control[data-checked]:not([data-invalid]) {\n --radio-bg: var(--color-action-neutral-base);\n --radio-border: transparent;\n --radio-dot-color: var(--color-on-neutral);\n}\n\n/* Focus */\n\n.control:focus-visible {\n outline-style: solid;\n outline-width: var(--stroke-focus-ring);\n outline-color: var(--color-action-info-base);\n outline-offset: var(--spacing-xxs);\n}\n\n/* Disabled — scoped to item root, mirrors group-level disabled */\n\n.root[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n & * {\n cursor: not-allowed;\n }\n}\n\n/* Invalid */\n\n.root[data-invalid] {\n --radio-border: var(--color-negative);\n --radio-label-color: var(--color-content-negative-base);\n}\n\n.control[data-invalid][data-checked] {\n --radio-bg: var(--color-negative);\n --radio-dot-color: var(--color-on-negative);\n}\n\n/* ─── Indicator (CSS dot) ─────────────────────────────────────────────────────── */\n\n.indicator {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n\n.indicator[data-unchecked] {\n display: none;\n}\n\n.indicator::before {\n content: \"\";\n display: block;\n width: 45%; /* proportional dot — scales with --radio-size */\n height: 45%;\n border-radius: 9999px;\n background-color: var(--radio-dot-color);\n transition: background-color 0.2s;\n}\n\n/* ─── Label ───────────────────────────────────────────────────────────────────── */\n\n.label {\n font-size: var(--radio-label-font-size, var(--typography-body-2-size));\n line-height: var(--radio-label-line-height, var(--typography-body-2-height));\n font-weight: var(--radio-label-font-weight, var(--typography-body-2-weight));\n color: var(--radio-label-color);\n}\n\n.label--hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":"AAYA,IAAA,EAAE,CAAA,QAAA,iBAAA,MAAA,eAAA,UAAA,mBAAA,MAAA,eAAA,gBAAA,uBAAA,KAAA,aAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Switch, SwitchProps } from "./switch.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./switch.js";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.Ld_P-G_root {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
border-style: solid;
|
|
4
|
+
border-width: .0625rem;
|
|
5
|
+
border-color: var(--color-border-primary);
|
|
6
|
+
background-color: var(--color-surface-tertiary);
|
|
7
|
+
padding: var(--spacing-xxs);
|
|
8
|
+
height: var(--root-height);
|
|
9
|
+
width: var(--root-width);
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
border-radius: var(--radius-full);
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
align-items: center;
|
|
14
|
+
transition: background-color .15s, border-color .15s, opacity .15s;
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.Ld_P-G_root[data-size="sm"] {
|
|
19
|
+
--root-width: 2rem;
|
|
20
|
+
--root-height: 1.125rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.Ld_P-G_root[data-size="md"] {
|
|
24
|
+
--root-width: 2.25rem;
|
|
25
|
+
--root-height: 1.25rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.Ld_P-G_root[data-size="lg"] {
|
|
29
|
+
--root-width: 2.625rem;
|
|
30
|
+
--root-height: 1.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.Ld_P-G_root[data-checked] {
|
|
34
|
+
background-color: var(--color-action-brand-base);
|
|
35
|
+
border-color: var(--color-action-brand-base);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.Ld_P-G_root[data-disabled] {
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
opacity: .6;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.Ld_P-G_root[data-readonly] {
|
|
44
|
+
cursor: default;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.Ld_P-G_root:focus-visible {
|
|
48
|
+
outline-style: solid;
|
|
49
|
+
outline-width: var(--stroke-focus-ring);
|
|
50
|
+
outline-color: var(--color-action-info-base);
|
|
51
|
+
outline-offset: var(--spacing-xxs);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.Ld_P-G_thumb {
|
|
55
|
+
--thumb-size: calc(var(--root-height) - var(--spacing-xs));
|
|
56
|
+
background-color: var(--color-on-brand);
|
|
57
|
+
border-radius: var(--radius-full);
|
|
58
|
+
height: var(--thumb-size);
|
|
59
|
+
width: var(--thumb-size);
|
|
60
|
+
translate: calc(-1 * var(--spacing-xxs) / 2) 0;
|
|
61
|
+
transition: translate .15s, background-color .15s;
|
|
62
|
+
display: block;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.Ld_P-G_root[data-checked] .Ld_P-G_thumb {
|
|
66
|
+
translate: calc(var(--root-width) - var(--thumb-size) - (2 * var(--spacing-xxs)))
|
|
67
|
+
0;
|
|
68
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Switch } from "@base-ui/react/switch";
|
|
2
|
+
|
|
3
|
+
//#region src/atoms/switch/switch.d.ts
|
|
4
|
+
type SwitchProps = Switch.Root.Props & {
|
|
5
|
+
/**
|
|
6
|
+
* Visual size of the switch.
|
|
7
|
+
* (Design-system prop; maps to CSS.)
|
|
8
|
+
*/
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
};
|
|
11
|
+
declare function Switch$1({
|
|
12
|
+
className,
|
|
13
|
+
size,
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
}: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Switch$1 as Switch, SwitchProps };
|
|
19
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"./switch.module.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{Switch as r}from"@base-ui/react/switch";function i({className:i,size:a=`md`,children:o,...s}){return n(r.Root,{...s,"data-size":a,className:[e.root,i].filter(Boolean).join(` `),children:[t(r.Thumb,{className:e.thumb}),o]})}export{i as Switch};
|
|
2
|
+
//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","names":["Switch","BaseSwitch","styles"],"sources":["../../../src/atoms/switch/switch.tsx"],"sourcesContent":["import { Switch as BaseSwitch } from \"@base-ui/react/switch\";\n\nimport styles from \"./switch.module.css\";\n\nexport type SwitchProps = BaseSwitch.Root.Props & {\n /**\n * Visual size of the switch.\n * (Design-system prop; maps to CSS.)\n */\n size?: \"sm\" | \"md\" | \"lg\";\n};\n\nexport function Switch({\n className,\n size = \"md\",\n children,\n ...props\n}: SwitchProps) {\n return (\n <BaseSwitch.Root\n {...props}\n data-size={size}\n className={[styles[\"root\"], className].filter(Boolean).join(\" \")}\n >\n {/* Base UI expects you to assemble parts; Thumb is always present in our DS */}\n <BaseSwitch.Thumb className={styles[\"thumb\"]} />\n {children}\n </BaseSwitch.Root>\n );\n}\n"],"mappings":"mIAYA,SAAgBA,EAAO,CACrB,YACA,OAAO,KACP,WACA,GAAG,GACW,CACd,OACE,EAACC,EAAW,KAAZ,CACE,GAAI,EACJ,YAAW,EACX,UAAW,CAACC,EAAO,KAAS,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,WAHjE,CAME,EAACD,EAAW,MAAZ,CAAkB,UAAWC,EAAO,KAAW,CAAA,EAC9C,CACc,GAErB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.module.js","names":[],"sources":["../../../src/atoms/switch/switch.module.css"],"sourcesContent":[".root {\n /* Layout */\n box-sizing: border-box;\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n\n /* Track shape */\n border-style: solid;\n border-width: 0.0625rem; /* 1px */\n border-color: var(--color-border-primary);\n background-color: var(--color-surface-tertiary);\n padding: var(--spacing-xxs); /* 0.125rem */\n\n height: var(--root-height);\n width: var(--root-width);\n\n /* Interaction */\n cursor: pointer;\n border-radius: var(--radius-full);\n transition:\n background-color 150ms ease,\n border-color 150ms ease,\n opacity 150ms ease;\n}\n\n/* Sizes (track) */\n.root[data-size=\"sm\"] {\n --root-width: 2rem; /* 32px */\n --root-height: 1.125rem; /* 18px */\n}\n\n.root[data-size=\"md\"] {\n --root-width: 2.25rem; /* 36px */\n --root-height: 1.25rem; /* 20px */\n}\n\n.root[data-size=\"lg\"] {\n --root-width: 2.625rem; /* 42px */\n --root-height: 1.5rem; /* 24px */\n}\n\n/* Checked track */\n.root[data-checked] {\n background-color: var(--color-action-brand-base);\n border-color: var(--color-action-brand-base);\n}\n\n/* Disabled */\n.root[data-disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n/* Readonly */\n.root[data-readonly] {\n cursor: default;\n}\n\n/* Focus ring\n If you standardize on [data-focus-visible] later, swap selector accordingly. */\n.root:focus-visible {\n outline-style: solid;\n outline-width: var(--stroke-focus-ring);\n outline-color: var(--color-action-info-base);\n outline-offset: var(--spacing-xxs);\n}\n\n/* Thumb */\n.thumb {\n --thumb-size: calc(var(--root-height) - var(--spacing-xs));\n display: block;\n background-color: var(--color-on-brand);\n border-radius: var(--radius-full);\n transition:\n translate 150ms ease,\n background-color 150ms ease;\n\n height: var(--thumb-size);\n width: var(--thumb-size);\n\n translate: calc(-1 * var(--spacing-xxs) / 2) 0;\n}\n\n/* Thumb position when checked */\n.root[data-checked] .thumb {\n translate: calc(\n var(--root-width) - var(--thumb-size) - (2 * var(--spacing-xxs))\n )\n 0;\n}\n"],"mappings":"AAIA,IAAA,EAAe,CAAC,KAAA,cAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Tabs as Tabs$1, TabsList, TabsListProps, TabsPanel, TabsPanelProps, TabsTab, TabsTabProps } from "./tabs.js";
|
|
2
|
+
import { TabsListState, TabsPanelState, TabsRootChangeEventDetails, TabsRootState, TabsTabState, TabsTabValue } from "@base-ui/react/tabs";
|
|
3
|
+
export type { TabsListState, TabsPanelState, TabsRootChangeEventDetails, TabsRootState, TabsTabState, TabsTabValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./tabs.js";
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
._5jD7lW_root {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
._5jD7lW_list {
|
|
7
|
+
z-index: 1;
|
|
8
|
+
gap: var(--spacing-sm);
|
|
9
|
+
border-bottom: .0625rem solid var(--color-border-primary);
|
|
10
|
+
display: flex;
|
|
11
|
+
position: relative;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
._5jD7lW_tab {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
color: var(--color-content-neutral-tertiary);
|
|
17
|
+
font-family: var(--typography-typeface-ltr);
|
|
18
|
+
font-size: var(--typography-caption-base-size);
|
|
19
|
+
-webkit-user-select: none;
|
|
20
|
+
user-select: none;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
word-break: keep-all;
|
|
23
|
+
padding-inline: var(--spacing-md);
|
|
24
|
+
padding-block: var(--spacing-sm);
|
|
25
|
+
background: none;
|
|
26
|
+
border: none;
|
|
27
|
+
border-bottom: .125rem solid #0000;
|
|
28
|
+
outline: none;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
align-items: center;
|
|
31
|
+
height: 2.5rem;
|
|
32
|
+
margin: 0;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
line-height: 1.4;
|
|
35
|
+
transition: color .15s ease-in-out, border .15s ease-in-out, background-color .15s ease-in-out;
|
|
36
|
+
display: flex;
|
|
37
|
+
|
|
38
|
+
@media (hover: hover) {
|
|
39
|
+
&:hover {
|
|
40
|
+
color: var(--color-content-neutral-strong);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[data-active] {
|
|
45
|
+
color: var(--color-content-brand-base);
|
|
46
|
+
border-bottom-color: var(--color-brand-primary);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
outline: var(--stroke-focus-ring) solid var(--color-action-info-base);
|
|
51
|
+
outline-offset: -1px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
._5jD7lW_indicator {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
z-index: -1;
|
|
58
|
+
background-color: var(--color-border-primary);
|
|
59
|
+
border-radius: var(--spacing-xxs) var(--spacing-xxs) 0 0;
|
|
60
|
+
height: .125rem;
|
|
61
|
+
transition: translate, width, background-color .15s ease-in-out;
|
|
62
|
+
position: absolute;
|
|
63
|
+
bottom: -1px;
|
|
64
|
+
left: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
._5jD7lW_panel {
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
width: 100%;
|
|
70
|
+
min-height: 8rem;
|
|
71
|
+
padding: var(--spacing-lg);
|
|
72
|
+
color: var(--color-content-primary);
|
|
73
|
+
background-color: var(--color-surface-secondary);
|
|
74
|
+
border: .0625rem solid var(--color-border-secondary);
|
|
75
|
+
border-top: none;
|
|
76
|
+
border-end-end-radius: var(--spacing-sm);
|
|
77
|
+
border-end-start-radius: var(--spacing-sm);
|
|
78
|
+
grid-area: 1 / 1;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
align-items: center;
|
|
81
|
+
display: flex;
|
|
82
|
+
|
|
83
|
+
&:focus-visible {
|
|
84
|
+
outline: var(--stroke-focus-ring) solid var(--color-action-info-base);
|
|
85
|
+
outline-offset: -1px;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&[hidden] {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tabs } from "@base-ui/react/tabs";
|
|
3
|
+
|
|
4
|
+
//#region src/atoms/tabs/tabs.d.ts
|
|
5
|
+
type TabsProps = Tabs.Root.Props & {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare function Tabs$1({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
type TabsListProps = Tabs.List.Props & {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to render the active tab indicator.
|
|
17
|
+
*/
|
|
18
|
+
indicator?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Class name applied to the indicator.
|
|
21
|
+
*/
|
|
22
|
+
indicatorClassName?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function TabsList({
|
|
25
|
+
children,
|
|
26
|
+
className,
|
|
27
|
+
indicator,
|
|
28
|
+
indicatorClassName,
|
|
29
|
+
...props
|
|
30
|
+
}: TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
type TabsTabProps = Tabs.Tab.Props;
|
|
32
|
+
declare function TabsTab({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: TabsTabProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
type TabsPanelProps = Tabs.Panel.Props;
|
|
37
|
+
declare function TabsPanel({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Tabs$1 as Tabs, TabsList, TabsListProps, TabsPanel, TabsPanelProps, TabsTab, TabsTabProps };
|
|
43
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"./tabs.module.js";import t from"clsx";import"react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{Tabs as i}from"@base-ui/react/tabs";function a({children:t,className:r,...a}){return n(i.Root,{...a,className:[e.root,r].filter(Boolean).join(` `),children:t})}function o({children:a,className:o,indicator:s=!0,indicatorClassName:c,...l}){return r(i.List,{...l,className:t(e.list,o),children:[a,s?n(i.Indicator,{className:t(e.indicator,c)}):null]})}function s({className:r,...a}){return n(i.Tab,{...a,className:t(e.tab,r)})}function c({className:r,...a}){return n(i.Panel,{...a,className:t(e.panel,r)})}export{a as Tabs,o as TabsList,c as TabsPanel,s as TabsTab};
|
|
2
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","names":["Tabs","BaseTabs","styles"],"sources":["../../../src/atoms/tabs/tabs.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\n\nimport styles from \"./tabs.module.css\";\nimport clsx from \"clsx\";\n\nexport type TabsProps = BaseTabs.Root.Props & {\n children: React.ReactNode;\n};\n\nexport function Tabs({ children, className, ...props }: TabsProps) {\n return (\n <BaseTabs.Root\n {...props}\n className={[styles[\"root\"], className].filter(Boolean).join(\" \")}\n >\n {children}\n </BaseTabs.Root>\n );\n}\n\nexport type TabsListProps = BaseTabs.List.Props & {\n children: React.ReactNode;\n /**\n * Whether to render the active tab indicator.\n */\n indicator?: boolean;\n /**\n * Class name applied to the indicator.\n */\n indicatorClassName?: string;\n};\n\nexport function TabsList({\n children,\n className,\n indicator = true,\n indicatorClassName,\n ...props\n}: TabsListProps) {\n return (\n <BaseTabs.List {...props} className={clsx(styles[\"list\"], className)}>\n {children}\n {indicator ? (\n <BaseTabs.Indicator\n className={clsx(styles[\"indicator\"], indicatorClassName)}\n />\n ) : null}\n </BaseTabs.List>\n );\n}\n\nexport type TabsTabProps = BaseTabs.Tab.Props;\n\nexport function TabsTab({ className, ...props }: TabsTabProps) {\n return <BaseTabs.Tab {...props} className={clsx(styles[\"tab\"], className)} />;\n}\n\nexport type TabsPanelsProps = React.ComponentPropsWithoutRef<\"div\">;\n\nexport function TabsPanels({ className, ...props }: TabsPanelsProps) {\n return <div {...props} className={clsx(styles[\"panels\"], className)} />;\n}\n\nexport type TabsPanelProps = BaseTabs.Panel.Props;\n\nexport function TabsPanel({ className, ...props }: TabsPanelProps) {\n return (\n <BaseTabs.Panel {...props} className={clsx(styles[\"panel\"], className)} />\n );\n}\n"],"mappings":"+JAUA,SAAgBA,EAAK,CAAE,WAAU,YAAW,GAAG,GAAoB,CACjE,OACE,EAACC,EAAS,KAAV,CACE,GAAI,EACJ,UAAW,CAACC,EAAO,KAAS,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAE9D,UACY,CAAA,CAEnB,CAcA,SAAgB,EAAS,CACvB,WACA,YACA,YAAY,GACZ,qBACA,GAAG,GACa,CAChB,OACE,EAACD,EAAS,KAAV,CAAe,GAAI,EAAO,UAAW,EAAKC,EAAO,KAAS,CAAS,WAAnE,CACG,EACA,EACC,EAACD,EAAS,UAAV,CACE,UAAW,EAAKC,EAAO,UAAc,CAAkB,CACxD,CAAA,EACC,IACS,GAEnB,CAIA,SAAgB,EAAQ,CAAE,YAAW,GAAG,GAAuB,CAC7D,OAAO,EAACD,EAAS,IAAV,CAAc,GAAI,EAAO,UAAW,EAAKC,EAAO,IAAQ,CAAS,CAAI,CAAA,CAC9E,CAUA,SAAgB,EAAU,CAAE,YAAW,GAAG,GAAyB,CACjE,OACE,EAACD,EAAS,MAAV,CAAgB,GAAI,EAAO,UAAW,EAAKC,EAAO,MAAU,CAAS,CAAI,CAAA,CAE7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.module.js","names":[],"sources":["../../../src/atoms/tabs/tabs.module.css"],"sourcesContent":[".root {\n box-sizing: border-box;\n width: 100%;\n}\n\n.list {\n display: flex;\n position: relative;\n z-index: 1;\n gap: var(--spacing-sm);\n border-bottom: 0.0625rem solid var(--color-border-primary);\n}\n\n.tab {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n\n border: none;\n border-bottom-color: transparent;\n border-bottom-width: 0.125rem;\n border-bottom-style: solid;\n\n margin: 0;\n outline: none;\n background: none;\n color: var(--color-content-neutral-tertiary);\n font-family: var(--typography-typeface-ltr);\n font-size: var(--typography-caption-base-size);\n line-height: 1.4;\n font-weight: 400;\n -webkit-user-select: none;\n user-select: none;\n white-space: nowrap;\n word-break: keep-all;\n padding-inline: var(--spacing-md);\n padding-block: var(--spacing-sm);\n height: 2.5rem;\n\n transition:\n color 150ms ease-in-out,\n border 150ms ease-in-out,\n background-color 150ms ease-in-out;\n\n @media (hover: hover) {\n &:hover {\n color: var(--color-content-neutral-strong);\n }\n }\n\n &[data-active] {\n color: var(--color-content-brand-base);\n border-bottom-color: var(--color-brand-primary);\n }\n\n &:focus-visible {\n outline: var(--stroke-focus-ring) solid var(--color-action-info-base);\n outline-offset: -1px;\n }\n}\n\n.indicator {\n box-sizing: border-box;\n position: absolute;\n z-index: -1;\n bottom: -1px;\n left: 0;\n height: 0.125rem;\n background-color: var(--color-border-primary);\n transition:\n translate,\n width,\n background-color 150ms ease-in-out;\n border-radius: var(--spacing-xxs) var(--spacing-xxs) 0 0;\n}\n\n.panel {\n box-sizing: border-box;\n grid-area: 1 / 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 8rem;\n padding: var(--spacing-lg);\n color: var(--color-content-primary);\n background-color: var(--color-surface-secondary);\n border: 0.0625rem solid var(--color-border-secondary);\n border-top: none;\n border-end-end-radius: var(--spacing-sm);\n border-end-start-radius: var(--spacing-sm);\n\n &:focus-visible {\n outline: var(--stroke-focus-ring) solid var(--color-action-info-base);\n outline-offset: -1px;\n z-index: 1;\n }\n\n &[hidden] {\n display: none;\n }\n}\n"],"mappings":"AAUA,IAAA,EAAS,CAAA,UAAU,oBAAA,KAAA,eAAA,MAAA,gBAAA,KAAA,eAAA,IAAA,aAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Text, TextColor, TextProps, TextVariant } from "./text.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./text.js";
|