@dashx/react 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/button.d.ts +2 -1
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +3 -3
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +2 -2
- package/dist/cjs/components/checkbox.d.ts +18 -0
- package/dist/cjs/components/checkbox.js +2 -0
- package/dist/cjs/components/checkbox.js.map +7 -0
- package/dist/cjs/components/flex.d.ts +321 -16
- package/dist/cjs/components/flex.js +1 -1
- package/dist/cjs/components/flex.js.map +3 -3
- package/dist/cjs/components/form.d.ts +11 -0
- package/dist/cjs/components/form.js +2 -0
- package/dist/cjs/components/form.js.map +7 -0
- package/dist/cjs/components/index.d.ts +5 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/link.d.ts +10 -0
- package/dist/cjs/components/link.js +2 -0
- package/dist/cjs/components/link.js.map +7 -0
- package/dist/cjs/components/number-field.d.ts +11 -0
- package/dist/cjs/components/number-field.js +2 -0
- package/dist/cjs/components/number-field.js.map +7 -0
- package/dist/cjs/components/popover.d.ts +6 -6
- package/dist/cjs/components/text-area.d.ts +11 -0
- package/dist/cjs/components/text-area.js +2 -0
- package/dist/cjs/components/text-area.js.map +7 -0
- package/dist/cjs/components/text-field.d.ts +10 -1
- package/dist/cjs/components/text-field.js +1 -1
- package/dist/cjs/components/text-field.js.map +3 -3
- package/dist/cjs/components/text.d.ts +1 -1
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +3 -3
- package/dist/cjs/components/theme.d.ts +2 -0
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +3 -3
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/tooltip.js.map +2 -2
- package/dist/cjs/hooks/index.d.ts +1 -0
- package/dist/cjs/hooks/index.js +1 -1
- package/dist/cjs/hooks/index.js.map +3 -3
- package/dist/cjs/hooks/use-in-app.js +1 -1
- package/dist/cjs/hooks/use-in-app.js.map +3 -3
- package/dist/cjs/hooks/use-product-release.d.ts +6 -0
- package/dist/cjs/hooks/use-product-release.js +2 -0
- package/dist/cjs/hooks/use-product-release.js.map +7 -0
- package/dist/cjs/providers/DashXProvider.d.ts +7 -2
- package/dist/cjs/providers/DashXProvider.js +1 -1
- package/dist/cjs/providers/DashXProvider.js.map +3 -3
- package/dist/cjs/providers/index.d.ts +1 -1
- package/dist/cjs/providers/index.js +1 -1
- package/dist/cjs/providers/index.js.map +2 -2
- package/dist/cjs/utils/helpers.d.ts +2 -0
- package/dist/cjs/utils/helpers.js +2 -0
- package/dist/cjs/utils/helpers.js.map +7 -0
- package/dist/cjs/variants/base-element.d.ts +91 -0
- package/dist/cjs/variants/base-element.js +1 -1
- package/dist/cjs/variants/base-element.js.map +2 -2
- package/dist/cjs/variants/base-field.d.ts +236 -0
- package/dist/cjs/variants/base-field.js +2 -0
- package/dist/cjs/variants/base-field.js.map +7 -0
- package/dist/cjs/variants/base-input.d.ts +5 -0
- package/dist/cjs/variants/base-input.js +2 -0
- package/dist/cjs/variants/base-input.js.map +7 -0
- package/dist/cjs/variants/button.d.ts +122 -15
- package/dist/cjs/variants/button.js +1 -1
- package/dist/cjs/variants/button.js.map +2 -2
- package/dist/cjs/variants/card.d.ts +2 -2
- package/dist/cjs/variants/card.js +1 -1
- package/dist/cjs/variants/card.js.map +2 -2
- package/dist/cjs/variants/checkbox.d.ts +41 -0
- package/dist/cjs/variants/checkbox.js +2 -0
- package/dist/cjs/variants/checkbox.js.map +7 -0
- package/dist/cjs/variants/field-error.d.ts +149 -0
- package/dist/cjs/variants/field-error.js +2 -0
- package/dist/cjs/variants/field-error.js.map +7 -0
- package/dist/cjs/variants/heading.d.ts +45 -0
- package/dist/cjs/variants/index.d.ts +2 -0
- package/dist/cjs/variants/index.js +1 -1
- package/dist/cjs/variants/index.js.map +2 -2
- package/dist/cjs/variants/link.d.ts +470 -0
- package/dist/cjs/variants/link.js +2 -0
- package/dist/cjs/variants/link.js.map +7 -0
- package/dist/cjs/variants/popover.d.ts +4 -4
- package/dist/cjs/variants/popover.js +1 -1
- package/dist/cjs/variants/popover.js.map +2 -2
- package/dist/cjs/variants/text-area.d.ts +298 -0
- package/dist/cjs/variants/text-area.js +2 -0
- package/dist/cjs/variants/text-area.js.map +7 -0
- package/dist/cjs/variants/text-field.d.ts +218 -13
- package/dist/cjs/variants/text-field.js +1 -1
- package/dist/cjs/variants/text-field.js.map +3 -3
- package/dist/cjs/variants/text.d.ts +48 -1
- package/dist/cjs/variants/text.js +1 -1
- package/dist/cjs/variants/text.js.map +2 -2
- package/dist/cjs/variants/tooltip.d.ts +1 -1
- package/dist/cjs/variants/tooltip.js +1 -1
- package/dist/cjs/variants/tooltip.js.map +2 -2
- package/dist/cjs/variants/typography.d.ts +35 -0
- package/dist/cjs/variants/typography.js +1 -1
- package/dist/cjs/variants/typography.js.map +2 -2
- package/dist/esm/components/button.d.ts +2 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +3 -3
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.js.map +2 -2
- package/dist/esm/components/checkbox.d.ts +18 -0
- package/dist/esm/components/checkbox.js +2 -0
- package/dist/esm/components/checkbox.js.map +7 -0
- package/dist/esm/components/flex.d.ts +321 -16
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/flex.js.map +3 -3
- package/dist/esm/components/form.d.ts +11 -0
- package/dist/esm/components/form.js +2 -0
- package/dist/esm/components/form.js.map +7 -0
- package/dist/esm/components/index.d.ts +5 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/link.d.ts +10 -0
- package/dist/esm/components/link.js +2 -0
- package/dist/esm/components/link.js.map +7 -0
- package/dist/esm/components/number-field.d.ts +11 -0
- package/dist/esm/components/number-field.js +2 -0
- package/dist/esm/components/number-field.js.map +7 -0
- package/dist/esm/components/popover.d.ts +6 -6
- package/dist/esm/components/text-area.d.ts +11 -0
- package/dist/esm/components/text-area.js +2 -0
- package/dist/esm/components/text-area.js.map +7 -0
- package/dist/esm/components/text-field.d.ts +10 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text-field.js.map +3 -3
- package/dist/esm/components/text.d.ts +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +3 -3
- package/dist/esm/components/theme.d.ts +2 -0
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/theme.js.map +3 -3
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/tooltip.js.map +2 -2
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/index.js.map +2 -2
- package/dist/esm/hooks/use-in-app.js +1 -1
- package/dist/esm/hooks/use-in-app.js.map +3 -3
- package/dist/esm/hooks/use-product-release.d.ts +6 -0
- package/dist/esm/hooks/use-product-release.js +2 -0
- package/dist/esm/hooks/use-product-release.js.map +7 -0
- package/dist/esm/providers/DashXProvider.d.ts +7 -2
- package/dist/esm/providers/DashXProvider.js +1 -1
- package/dist/esm/providers/DashXProvider.js.map +3 -3
- package/dist/esm/providers/index.d.ts +1 -1
- package/dist/esm/providers/index.js +1 -1
- package/dist/esm/providers/index.js.map +3 -3
- package/dist/esm/utils/helpers.d.ts +2 -0
- package/dist/esm/utils/helpers.js +2 -0
- package/dist/esm/utils/helpers.js.map +7 -0
- package/dist/esm/variants/base-element.d.ts +91 -0
- package/dist/esm/variants/base-element.js +1 -1
- package/dist/esm/variants/base-element.js.map +2 -2
- package/dist/esm/variants/base-field.d.ts +236 -0
- package/dist/esm/variants/base-field.js +2 -0
- package/dist/esm/variants/base-field.js.map +7 -0
- package/dist/esm/variants/base-input.d.ts +5 -0
- package/dist/esm/variants/base-input.js +2 -0
- package/dist/esm/variants/base-input.js.map +7 -0
- package/dist/esm/variants/button.d.ts +122 -15
- package/dist/esm/variants/button.js +1 -1
- package/dist/esm/variants/button.js.map +2 -2
- package/dist/esm/variants/card.d.ts +2 -2
- package/dist/esm/variants/card.js +1 -1
- package/dist/esm/variants/card.js.map +2 -2
- package/dist/esm/variants/checkbox.d.ts +41 -0
- package/dist/esm/variants/checkbox.js +2 -0
- package/dist/esm/variants/checkbox.js.map +7 -0
- package/dist/esm/variants/field-error.d.ts +149 -0
- package/dist/esm/variants/field-error.js +2 -0
- package/dist/esm/variants/field-error.js.map +7 -0
- package/dist/esm/variants/heading.d.ts +45 -0
- package/dist/esm/variants/index.d.ts +2 -0
- package/dist/esm/variants/index.js +1 -1
- package/dist/esm/variants/index.js.map +2 -2
- package/dist/esm/variants/link.d.ts +470 -0
- package/dist/esm/variants/link.js +2 -0
- package/dist/esm/variants/link.js.map +7 -0
- package/dist/esm/variants/popover.d.ts +4 -4
- package/dist/esm/variants/popover.js +1 -1
- package/dist/esm/variants/popover.js.map +2 -2
- package/dist/esm/variants/text-area.d.ts +298 -0
- package/dist/esm/variants/text-area.js +2 -0
- package/dist/esm/variants/text-area.js.map +7 -0
- package/dist/esm/variants/text-field.d.ts +218 -13
- package/dist/esm/variants/text-field.js +1 -1
- package/dist/esm/variants/text-field.js.map +3 -3
- package/dist/esm/variants/text.d.ts +48 -1
- package/dist/esm/variants/text.js +1 -1
- package/dist/esm/variants/text.js.map +2 -2
- package/dist/esm/variants/tooltip.d.ts +1 -1
- package/dist/esm/variants/tooltip.js +1 -1
- package/dist/esm/variants/tooltip.js.map +2 -2
- package/dist/esm/variants/typography.d.ts +35 -0
- package/dist/esm/variants/typography.js +1 -1
- package/dist/esm/variants/typography.js.map +2 -2
- package/package.json +5 -6
- package/src/components/button.tsx +17 -21
- package/src/components/card.tsx +2 -2
- package/src/components/checkbox.tsx +255 -0
- package/src/components/flex.tsx +17 -7
- package/src/components/form.tsx +30 -0
- package/src/components/index.ts +5 -0
- package/src/components/link.tsx +90 -0
- package/src/components/number-field.tsx +174 -0
- package/src/components/text-area.tsx +107 -0
- package/src/components/text-field.tsx +103 -3
- package/src/components/text.tsx +13 -4
- package/src/components/theme.tsx +16 -4
- package/src/components/tooltip.tsx +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-in-app.ts +17 -58
- package/src/hooks/use-product-release.ts +38 -0
- package/src/providers/DashXProvider.tsx +91 -5
- package/src/providers/index.ts +1 -1
- package/src/styles/index.css +180 -43
- package/src/utils/helpers.ts +21 -0
- package/src/variants/base-element.ts +18 -5
- package/src/variants/base-field.ts +42 -0
- package/src/variants/base-input.ts +13 -0
- package/src/variants/button.ts +47 -27
- package/src/variants/card.ts +3 -3
- package/src/variants/checkbox.ts +33 -0
- package/src/variants/field-error.ts +29 -0
- package/src/variants/index.ts +2 -0
- package/src/variants/link.ts +34 -0
- package/src/variants/popover.ts +5 -5
- package/src/variants/text-area.ts +26 -0
- package/src/variants/text-field.ts +14 -3
- package/src/variants/text.ts +2 -1
- package/src/variants/tooltip.ts +1 -1
- package/src/variants/typography.ts +14 -9
- package/styles.css +546 -124
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
|
@@ -3,11 +3,24 @@ import { tv } from 'tailwind-variants';
|
|
|
3
3
|
const baseElement = tv({
|
|
4
4
|
variants: {
|
|
5
5
|
size: {
|
|
6
|
-
extrasmall: '
|
|
7
|
-
small: '
|
|
8
|
-
medium: '
|
|
9
|
-
large: '
|
|
10
|
-
extralarge: '
|
|
6
|
+
extrasmall: 'h-6',
|
|
7
|
+
small: 'h-8',
|
|
8
|
+
medium: 'h-10',
|
|
9
|
+
large: 'h-12',
|
|
10
|
+
extralarge: 'h-14',
|
|
11
|
+
},
|
|
12
|
+
roundness: {
|
|
13
|
+
none: '',
|
|
14
|
+
small: '',
|
|
15
|
+
medium: '',
|
|
16
|
+
large: '',
|
|
17
|
+
full: '',
|
|
18
|
+
},
|
|
19
|
+
elevation: {
|
|
20
|
+
none: '',
|
|
21
|
+
small: '',
|
|
22
|
+
medium: '',
|
|
23
|
+
large: '',
|
|
11
24
|
},
|
|
12
25
|
},
|
|
13
26
|
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
import baseElement from './base-element.js';
|
|
4
|
+
import { baseInput } from './base-input.js';
|
|
5
|
+
|
|
6
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
7
|
+
|
|
8
|
+
const getSpacing = () => ({
|
|
9
|
+
extrasmall: 'py-[3px] px-2 pr-[calc(var(--spacing-2)+var(--append-padding-right,0px))] text-xs',
|
|
10
|
+
small: 'py-[7px] px-3 pr-[calc(var(--spacing-3)+var(--append-padding-right,0px))] text-xs',
|
|
11
|
+
medium: 'py-[9px] px-4 pr-[calc(var(--spacing-4)+var(--append-padding-right,0px))] text-sm',
|
|
12
|
+
large: 'py-3 px-4 pr-[calc(var(--spacing-4)+var(--append-padding-right,0px))] text-sm',
|
|
13
|
+
extralarge:
|
|
14
|
+
'py-[15px] px-6 pr-[calc(var(--spacing-6)+var(--append-padding-right,0px))] text-base',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const baseField = tv({
|
|
18
|
+
extend: baseElement,
|
|
19
|
+
base: baseInput(),
|
|
20
|
+
variants: {
|
|
21
|
+
size: getSpacing(),
|
|
22
|
+
roundness: {
|
|
23
|
+
none: '',
|
|
24
|
+
small: '',
|
|
25
|
+
medium: '',
|
|
26
|
+
large: '',
|
|
27
|
+
full: '',
|
|
28
|
+
},
|
|
29
|
+
elevation: {
|
|
30
|
+
none: '',
|
|
31
|
+
small: '',
|
|
32
|
+
medium: '',
|
|
33
|
+
large: '',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
type BaseFieldVariantProps = VariantProps<typeof baseField>;
|
|
39
|
+
|
|
40
|
+
export type { BaseFieldVariantProps };
|
|
41
|
+
|
|
42
|
+
export { baseField };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
const baseInput = tv({
|
|
6
|
+
base: 'data-[invalid="true"]:border-negative-300 data-[invalid="true"]:hover:border-negative-400 data-[invalid="true"]:focus:border-negative-500 data-[invalid="true"]:text-negative-500 data-[invalid="true"]:bg-negative-50 ease-fluid data-[invalid="true"]:focus:outline-negative-500 focus:outline-accent-500 autofill:bg-accent-300 !hover:border-gray-400 border border-gray-300 py-3 px-4 text-sm text-gray-900 outline-none transition-[box-shadow,background-color,color,border-color] duration-300',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
type BaseInputVariantProps = VariantProps<typeof baseInput>;
|
|
10
|
+
|
|
11
|
+
export type { BaseInputVariantProps };
|
|
12
|
+
|
|
13
|
+
export { baseInput };
|
package/src/variants/button.ts
CHANGED
|
@@ -6,33 +6,28 @@ import type { VariantProps } from 'tailwind-variants';
|
|
|
6
6
|
|
|
7
7
|
const button = tv({
|
|
8
8
|
extend: baseElement,
|
|
9
|
-
base: 'inline-flex items-center justify-center gap-2 outline-none transition-[box-shadow,background-color,color] duration-300
|
|
9
|
+
base: 'ease-fluid inline-flex items-center justify-center gap-2 outline-none transition-[box-shadow,background-color,color] duration-300 select-none data-[focus-visible]:outline-2 data-[focus-visible]:outline-offset-2 data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:shadow-none',
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
12
|
-
extrasmall: 'text-xs',
|
|
13
|
-
small: 'text-sm',
|
|
14
|
-
medium: 'text-base',
|
|
15
|
-
large: 'text-lg',
|
|
16
|
-
extralarge: 'text-xl',
|
|
12
|
+
extrasmall: 'rounded-sm-or-full text-xs',
|
|
13
|
+
small: 'rounded-sm-or-full text-sm',
|
|
14
|
+
medium: 'rounded-md-or-full text-base',
|
|
15
|
+
large: 'rounded-lg-or-full text-lg',
|
|
16
|
+
extralarge: 'rounded-lg-or-full text-xl',
|
|
17
17
|
},
|
|
18
18
|
variant: {
|
|
19
|
-
fill: 'text-
|
|
20
|
-
outline: '
|
|
21
|
-
simple: '
|
|
19
|
+
fill: 'text-bg',
|
|
20
|
+
outline: 'ring-2 ring-inset',
|
|
21
|
+
simple: 'ring-1 ring-inset hover:ring-2 data-[focus-visible]:ring-2',
|
|
22
22
|
ghost: '',
|
|
23
23
|
},
|
|
24
24
|
mode: {
|
|
25
|
-
distinct: 'data-[focus-visible]:outline-accent-
|
|
26
|
-
subtle: 'data-[focus-visible]:outline-accent-
|
|
27
|
-
negative: 'data-[focus-visible]:outline-negative-
|
|
28
|
-
},
|
|
29
|
-
roundness: {
|
|
30
|
-
none: '',
|
|
31
|
-
small: '',
|
|
32
|
-
medium: '',
|
|
33
|
-
large: '',
|
|
34
|
-
full: '',
|
|
25
|
+
distinct: 'data-[focus-visible]:outline-accent-500',
|
|
26
|
+
subtle: 'data-[focus-visible]:outline-accent-500',
|
|
27
|
+
negative: 'data-[focus-visible]:outline-negative-500',
|
|
35
28
|
},
|
|
29
|
+
roundness: {},
|
|
30
|
+
elevation: {},
|
|
36
31
|
shape: {
|
|
37
32
|
square: '',
|
|
38
33
|
rect: '',
|
|
@@ -42,7 +37,6 @@ const button = tv({
|
|
|
42
37
|
right: '',
|
|
43
38
|
both: '',
|
|
44
39
|
},
|
|
45
|
-
// TODO: shadow
|
|
46
40
|
},
|
|
47
41
|
defaultVariants: {
|
|
48
42
|
size: 'medium',
|
|
@@ -55,7 +49,7 @@ const button = tv({
|
|
|
55
49
|
mode: 'distinct',
|
|
56
50
|
variant: 'fill',
|
|
57
51
|
className:
|
|
58
|
-
'bg-accent-500 hover:bg-accent-600 active:bg-accent-700 shadow-accent-
|
|
52
|
+
'bg-accent-500 hover:bg-accent-600 active:bg-accent-700 shadow-accent-400/30 hover:shadow-accent-400/30 active:shadow-accent-400/30',
|
|
59
53
|
},
|
|
60
54
|
{
|
|
61
55
|
mode: 'distinct',
|
|
@@ -78,30 +72,30 @@ const button = tv({
|
|
|
78
72
|
mode: 'subtle',
|
|
79
73
|
variant: 'fill',
|
|
80
74
|
className:
|
|
81
|
-
'bg-gray-
|
|
75
|
+
'bg-gray-600 shadow-gray-400/30 hover:bg-gray-600 hover:shadow-lg hover:shadow-gray-400/30 active:bg-gray-700 active:shadow-gray-400/30',
|
|
82
76
|
},
|
|
83
77
|
{
|
|
84
78
|
mode: 'subtle',
|
|
85
79
|
variant: 'outline',
|
|
86
|
-
className: 'text-gray-
|
|
80
|
+
className: 'text-gray-600 hover:text-gray-600 active:text-gray-700',
|
|
87
81
|
},
|
|
88
82
|
{
|
|
89
83
|
mode: 'subtle',
|
|
90
84
|
variant: 'simple',
|
|
91
85
|
className:
|
|
92
|
-
'text-gray-
|
|
86
|
+
'text-gray-600 hover:text-gray-600 hover:ring-gray-600 active:text-gray-700 active:ring-gray-700',
|
|
93
87
|
},
|
|
94
88
|
{
|
|
95
89
|
mode: 'subtle',
|
|
96
90
|
variant: 'ghost',
|
|
97
91
|
className:
|
|
98
|
-
'text-gray-
|
|
92
|
+
'text-gray-600 hover:bg-gray-100 hover:text-gray-600 active:bg-gray-200 active:text-gray-700',
|
|
99
93
|
},
|
|
100
94
|
{
|
|
101
95
|
mode: 'negative',
|
|
102
96
|
variant: 'fill',
|
|
103
97
|
className:
|
|
104
|
-
'bg-negative-500 hover:bg-negative-600 active:bg-negative-700 shadow-negative-
|
|
98
|
+
'bg-negative-500 hover:bg-negative-600 active:bg-negative-700 shadow-negative-400/30 hover:shadow-negative-400/30 active:shadow-negative-400/30',
|
|
105
99
|
},
|
|
106
100
|
{
|
|
107
101
|
mode: 'negative',
|
|
@@ -143,7 +137,7 @@ const button = tv({
|
|
|
143
137
|
shape: 'rect',
|
|
144
138
|
size: 'large',
|
|
145
139
|
className:
|
|
146
|
-
'min-w-
|
|
140
|
+
'min-w-24 px-6 data-[inset=left]:-ml-6 data-[inset=right]:-mr-6 data-[inset=both]:-mx-6',
|
|
147
141
|
},
|
|
148
142
|
{
|
|
149
143
|
shape: 'rect',
|
|
@@ -181,6 +175,32 @@ const button = tv({
|
|
|
181
175
|
className:
|
|
182
176
|
'size-14 p-5 data-[inset=left]:-ml-5 data-[inset=right]:-mr-5 data-[inset=both]:-mx-5',
|
|
183
177
|
},
|
|
178
|
+
|
|
179
|
+
{
|
|
180
|
+
size: 'extrasmall',
|
|
181
|
+
variant: 'fill',
|
|
182
|
+
className: 'shadow-2xs active:shadow-2xs hover:shadow-sm',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
size: 'small',
|
|
186
|
+
variant: 'fill',
|
|
187
|
+
className: 'shadow-2xs active:shadow-2xs hover:shadow-sm',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
size: 'medium',
|
|
191
|
+
variant: 'fill',
|
|
192
|
+
className: 'shadow-xs hover:shadow-md active:shadow-xs',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
size: 'large',
|
|
196
|
+
variant: 'fill',
|
|
197
|
+
className: 'shadow-sm hover:shadow-lg active:shadow-sm',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
size: 'extralarge',
|
|
201
|
+
variant: 'fill',
|
|
202
|
+
className: 'shadow-sm hover:shadow-lg active:shadow-sm',
|
|
203
|
+
},
|
|
184
204
|
],
|
|
185
205
|
});
|
|
186
206
|
|
package/src/variants/card.ts
CHANGED
|
@@ -11,12 +11,12 @@ const SPACING = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const card = tv({
|
|
14
|
-
base: 'shadow-2xs bg-
|
|
14
|
+
base: 'shadow-2xs bg-bg light:shadow-gray-400/30 border border-gray-400/40 p-[var(--padding)]',
|
|
15
15
|
variants: {
|
|
16
16
|
roundness: {
|
|
17
17
|
none: 'rounded-none',
|
|
18
|
-
small: 'rounded-
|
|
19
|
-
medium: 'rounded-
|
|
18
|
+
small: 'rounded-md',
|
|
19
|
+
medium: 'rounded-lg',
|
|
20
20
|
large: 'rounded-xl',
|
|
21
21
|
full: 'rounded-full',
|
|
22
22
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import { baseInput } from './base-input.js';
|
|
4
|
+
|
|
5
|
+
const checkbox = tv({
|
|
6
|
+
extend: baseInput,
|
|
7
|
+
base: 'data-[focus-visible]:outline-accent-500',
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
small: 'my-[1px] size-[14px] rounded-sm p-[1px]',
|
|
11
|
+
medium: 'my-[2px] size-4 rounded-md p-[2px]',
|
|
12
|
+
large: 'size-6 rounded-lg p-1',
|
|
13
|
+
},
|
|
14
|
+
roundness: {
|
|
15
|
+
none: '',
|
|
16
|
+
small: '',
|
|
17
|
+
medium: '',
|
|
18
|
+
large: '',
|
|
19
|
+
},
|
|
20
|
+
elevation: {
|
|
21
|
+
none: '',
|
|
22
|
+
small: '',
|
|
23
|
+
medium: '',
|
|
24
|
+
large: '',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
type CheckboxVariantProps = VariantProps<typeof checkbox>;
|
|
30
|
+
|
|
31
|
+
export type { CheckboxVariantProps };
|
|
32
|
+
|
|
33
|
+
export { checkbox };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
const fieldError = tv({
|
|
4
|
+
base: 'bg-negative-500 absolute top-[75%] z-[1] transform text-white',
|
|
5
|
+
variants: {
|
|
6
|
+
size: {
|
|
7
|
+
extrasmall: 'rounded-sm-or-full shadow-negative-600/30 left-3 py-1 px-2 shadow-xs',
|
|
8
|
+
small: 'rounded-sm-or-full shadow-negative-600/30 left-3 py-1 px-2 shadow-xs',
|
|
9
|
+
medium: 'rounded-sm-or-full shadow-negative-600/30 left-4 py-2 px-3 shadow-sm',
|
|
10
|
+
large: 'rounded-md-or-full shadow-negative-600/30 left-4 py-3 px-4 shadow-md',
|
|
11
|
+
extralarge: 'rounded-md-or-full shadow-negative-600/30 left-6 py-3 px-4 shadow-md',
|
|
12
|
+
},
|
|
13
|
+
roundness: {
|
|
14
|
+
none: '',
|
|
15
|
+
small: '',
|
|
16
|
+
medium: '',
|
|
17
|
+
large: '',
|
|
18
|
+
full: '',
|
|
19
|
+
},
|
|
20
|
+
elevation: {
|
|
21
|
+
none: '',
|
|
22
|
+
small: '',
|
|
23
|
+
medium: '',
|
|
24
|
+
large: '',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { fieldError };
|
package/src/variants/index.ts
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
+
|
|
4
|
+
import { text } from './text.js';
|
|
5
|
+
|
|
6
|
+
const link = tv({
|
|
7
|
+
extend: text,
|
|
8
|
+
base: 'ease-fluid underline-offset-2 outline-none transition-[opacity,color] duration-300 hover:opacity-100 data-[focus-visible]:opacity-100 data-[focus-visible]:outline-2 data-[focus-visible]:outline-offset-2 data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',
|
|
9
|
+
variants: {
|
|
10
|
+
align: {},
|
|
11
|
+
size: {},
|
|
12
|
+
weight: {},
|
|
13
|
+
color: {
|
|
14
|
+
accent: 'data-[focus-visible]:outline-accent-500 decoration-accent-500',
|
|
15
|
+
gray: 'data-[focus-visible]:outline-accent-500 decoration-gray-500',
|
|
16
|
+
negative: 'data-[focus-visible]:outline-negative-500 decoration-negative-500',
|
|
17
|
+
},
|
|
18
|
+
variant: {},
|
|
19
|
+
transform: {},
|
|
20
|
+
underline: {
|
|
21
|
+
always: 'underline decoration-2',
|
|
22
|
+
hover: 'decoration-0 hover:underline hover:decoration-2',
|
|
23
|
+
none: 'decoration-0',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
underline: 'always',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
type LinkVariantProps = VariantProps<typeof link>;
|
|
32
|
+
|
|
33
|
+
export type { LinkVariantProps };
|
|
34
|
+
export { link };
|
package/src/variants/popover.ts
CHANGED
|
@@ -3,12 +3,12 @@ import { tv } from 'tailwind-variants';
|
|
|
3
3
|
import type { VariantProps } from 'tailwind-variants';
|
|
4
4
|
|
|
5
5
|
const popover = tv({
|
|
6
|
-
base: 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 flex h-[var(--height)] max-h-[var(--max-height)] min-h-[var(--min-height)] w-[var(--width)] max-w-[var(--max-width)] min-w-[var(--min-width)] flex-col justify-start overflow-hidden
|
|
6
|
+
base: 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-bg light:shadow-gray-400/30 flex h-[var(--height)] max-h-[var(--max-height)] min-h-[var(--min-height)] w-[var(--width)] max-w-[var(--max-width)] min-w-[var(--min-width)] flex-col justify-start overflow-hidden border border-gray-400/40 shadow-md outline-0',
|
|
7
7
|
variants: {
|
|
8
8
|
roundness: {
|
|
9
9
|
none: 'rounded-none',
|
|
10
|
-
small: 'rounded-
|
|
11
|
-
medium: 'rounded-
|
|
10
|
+
small: 'rounded-md',
|
|
11
|
+
medium: 'rounded-lg',
|
|
12
12
|
large: 'rounded-xl',
|
|
13
13
|
full: 'rounded-full',
|
|
14
14
|
},
|
|
@@ -31,11 +31,11 @@ const popoverBody = tv({
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const popoverHeader = tv({
|
|
34
|
-
base: 'border-b border-b-gray-
|
|
34
|
+
base: 'border-b border-b-gray-400/40 p-[var(--padding)]',
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const popoverFooter = tv({
|
|
38
|
-
base: 'border-t border-t-gray-
|
|
38
|
+
base: 'border-t border-t-gray-400/40 p-[var(--padding)]',
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
export type { PopoverVariantProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
4
|
+
import { baseField } from './base-field.js';
|
|
5
|
+
|
|
6
|
+
const textArea = tv({
|
|
7
|
+
extend: baseField,
|
|
8
|
+
base: 'leading-3',
|
|
9
|
+
variants: {
|
|
10
|
+
elevation: {},
|
|
11
|
+
roundness: {},
|
|
12
|
+
size: {
|
|
13
|
+
extrasmall: 'rounded-sm',
|
|
14
|
+
small: 'rounded-sm',
|
|
15
|
+
medium: 'rounded-md',
|
|
16
|
+
large: 'rounded-lg',
|
|
17
|
+
extralarge: 'rounded-lg',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
type TextAreaVariantProps = VariantProps<typeof textArea>;
|
|
23
|
+
|
|
24
|
+
export type { TextAreaVariantProps };
|
|
25
|
+
|
|
26
|
+
export { textArea };
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import { baseField } from './base-field.js';
|
|
5
4
|
import type { VariantProps } from 'tailwind-variants';
|
|
6
5
|
|
|
7
6
|
const textField = tv({
|
|
8
|
-
extend:
|
|
7
|
+
extend: baseField,
|
|
8
|
+
base: 'py-3 px-4 text-sm text-gray-900',
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
extrasmall: 'rounded-sm-or-full',
|
|
12
|
+
small: 'rounded-sm-or-full',
|
|
13
|
+
medium: 'rounded-md-or-full',
|
|
14
|
+
large: 'rounded-lg-or-full',
|
|
15
|
+
extralarge: 'rounded-lg-or-full',
|
|
16
|
+
},
|
|
17
|
+
roundness: {},
|
|
18
|
+
elevation: {},
|
|
19
|
+
},
|
|
9
20
|
});
|
|
10
21
|
|
|
11
22
|
type TextFieldVariantProps = VariantProps<typeof textField>;
|
package/src/variants/text.ts
CHANGED
|
@@ -6,13 +6,14 @@ import type { VariantProps } from 'tailwind-variants';
|
|
|
6
6
|
|
|
7
7
|
const text = tv({
|
|
8
8
|
extend: typography,
|
|
9
|
-
base: 'text-gray-950',
|
|
9
|
+
base: 'rounded-sm text-gray-950',
|
|
10
10
|
variants: {
|
|
11
11
|
align: {},
|
|
12
12
|
size: {},
|
|
13
13
|
weight: {},
|
|
14
14
|
color: {},
|
|
15
15
|
variant: {},
|
|
16
|
+
transform: {},
|
|
16
17
|
},
|
|
17
18
|
defaultVariants: {
|
|
18
19
|
size: 3,
|
package/src/variants/tooltip.ts
CHANGED
|
@@ -5,6 +5,11 @@ import type { VariantProps } from 'tailwind-variants';
|
|
|
5
5
|
const typography = tv({
|
|
6
6
|
base: 'text-gray-950',
|
|
7
7
|
variants: {
|
|
8
|
+
transform: {
|
|
9
|
+
uppercase: 'uppercase',
|
|
10
|
+
capitalize: 'capitalize',
|
|
11
|
+
lowercase: 'lowercase',
|
|
12
|
+
},
|
|
8
13
|
align: {
|
|
9
14
|
center: 'text-center',
|
|
10
15
|
left: 'text-left',
|
|
@@ -49,47 +54,47 @@ const typography = tv({
|
|
|
49
54
|
{
|
|
50
55
|
color: 'accent',
|
|
51
56
|
variant: 'primary',
|
|
52
|
-
className: 'text-accent-950',
|
|
57
|
+
className: 'text-accent-950 opacity-[0.95]',
|
|
53
58
|
},
|
|
54
59
|
{
|
|
55
60
|
color: 'accent',
|
|
56
61
|
variant: 'secondary',
|
|
57
|
-
className: 'text-accent-900',
|
|
62
|
+
className: 'text-accent-900 opacity-[0.90]',
|
|
58
63
|
},
|
|
59
64
|
{
|
|
60
65
|
color: 'accent',
|
|
61
66
|
variant: 'tertiary',
|
|
62
|
-
className: 'text-accent-800',
|
|
67
|
+
className: 'text-accent-800 opacity-[0.80]',
|
|
63
68
|
},
|
|
64
69
|
{
|
|
65
70
|
color: 'gray',
|
|
66
71
|
variant: 'primary',
|
|
67
|
-
className: 'text-gray-950',
|
|
72
|
+
className: 'text-gray-950 opacity-[0.95]',
|
|
68
73
|
},
|
|
69
74
|
{
|
|
70
75
|
color: 'gray',
|
|
71
76
|
variant: 'secondary',
|
|
72
|
-
className: 'text-gray-900',
|
|
77
|
+
className: 'text-gray-900 opacity-[0.90]',
|
|
73
78
|
},
|
|
74
79
|
{
|
|
75
80
|
color: 'gray',
|
|
76
81
|
variant: 'tertiary',
|
|
77
|
-
className: 'text-gray-800',
|
|
82
|
+
className: 'text-gray-800 opacity-[0.80]',
|
|
78
83
|
},
|
|
79
84
|
{
|
|
80
85
|
color: 'negative',
|
|
81
86
|
variant: 'primary',
|
|
82
|
-
className: 'text-negative-950',
|
|
87
|
+
className: 'text-negative-950 opacity-[0.95]',
|
|
83
88
|
},
|
|
84
89
|
{
|
|
85
90
|
color: 'negative',
|
|
86
91
|
variant: 'secondary',
|
|
87
|
-
className: 'text-negative-900',
|
|
92
|
+
className: 'text-negative-900 opacity-[0.90]',
|
|
88
93
|
},
|
|
89
94
|
{
|
|
90
95
|
color: 'negative',
|
|
91
96
|
variant: 'tertiary',
|
|
92
|
-
className: 'text-negative-800',
|
|
97
|
+
className: 'text-negative-800 opacity-[0.80]',
|
|
93
98
|
},
|
|
94
99
|
],
|
|
95
100
|
});
|