@shipfox/react-ui 0.2.0 → 0.3.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.
Files changed (85) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/.turbo/turbo-check.log +3 -3
  3. package/.turbo/turbo-type.log +1 -1
  4. package/CHANGELOG.md +6 -0
  5. package/dist/components/alert/alert.d.ts +18 -0
  6. package/dist/components/alert/alert.d.ts.map +1 -0
  7. package/dist/components/alert/alert.js +123 -0
  8. package/dist/components/alert/alert.js.map +1 -0
  9. package/dist/components/alert/alert.stories.js +112 -0
  10. package/dist/components/alert/alert.stories.js.map +1 -0
  11. package/dist/components/alert/index.d.ts +2 -0
  12. package/dist/components/alert/index.d.ts.map +1 -0
  13. package/dist/components/alert/index.js +3 -0
  14. package/dist/components/alert/index.js.map +1 -0
  15. package/dist/components/avatar/avatar-group.d.ts +18 -0
  16. package/dist/components/avatar/avatar-group.d.ts.map +1 -0
  17. package/dist/components/avatar/avatar-group.js +132 -0
  18. package/dist/components/avatar/avatar-group.js.map +1 -0
  19. package/dist/components/avatar/avatar.d.ts +21 -0
  20. package/dist/components/avatar/avatar.d.ts.map +1 -0
  21. package/dist/components/avatar/avatar.js +166 -0
  22. package/dist/components/avatar/avatar.js.map +1 -0
  23. package/dist/components/avatar/avatar.stories.js +255 -0
  24. package/dist/components/avatar/avatar.stories.js.map +1 -0
  25. package/dist/components/avatar/index.d.ts +3 -0
  26. package/dist/components/avatar/index.d.ts.map +1 -0
  27. package/dist/components/avatar/index.js +4 -0
  28. package/dist/components/avatar/index.js.map +1 -0
  29. package/dist/components/icon/custom/index.d.ts +1 -0
  30. package/dist/components/icon/custom/index.d.ts.map +1 -1
  31. package/dist/components/icon/custom/index.js +1 -0
  32. package/dist/components/icon/custom/index.js.map +1 -1
  33. package/dist/components/icon/custom/shipfox-logo.d.ts +8 -0
  34. package/dist/components/icon/custom/shipfox-logo.d.ts.map +1 -0
  35. package/dist/components/icon/custom/shipfox-logo.js +22 -0
  36. package/dist/components/icon/custom/shipfox-logo.js.map +1 -0
  37. package/dist/components/icon/icon.d.ts +4 -1
  38. package/dist/components/icon/icon.d.ts.map +1 -1
  39. package/dist/components/icon/icon.js +6 -3
  40. package/dist/components/icon/icon.js.map +1 -1
  41. package/dist/components/index.d.ts +3 -0
  42. package/dist/components/index.d.ts.map +1 -1
  43. package/dist/components/index.js +3 -0
  44. package/dist/components/index.js.map +1 -1
  45. package/dist/components/inline-tips/index.d.ts +2 -0
  46. package/dist/components/inline-tips/index.d.ts.map +1 -0
  47. package/dist/components/inline-tips/index.js +3 -0
  48. package/dist/components/inline-tips/index.js.map +1 -0
  49. package/dist/components/inline-tips/inline-tips.d.ts +19 -0
  50. package/dist/components/inline-tips/inline-tips.d.ts.map +1 -0
  51. package/dist/components/inline-tips/inline-tips.js +98 -0
  52. package/dist/components/inline-tips/inline-tips.js.map +1 -0
  53. package/dist/components/inline-tips/inline-tips.stories.js +214 -0
  54. package/dist/components/inline-tips/inline-tips.stories.js.map +1 -0
  55. package/dist/components/tooltip/tooltip.d.ts +7 -0
  56. package/dist/components/tooltip/tooltip.d.ts.map +1 -0
  57. package/dist/components/tooltip/tooltip.js +38 -0
  58. package/dist/components/tooltip/tooltip.js.map +1 -0
  59. package/dist/utils/avatar.d.ts +3 -0
  60. package/dist/utils/avatar.d.ts.map +1 -0
  61. package/dist/utils/avatar.js +32 -0
  62. package/dist/utils/avatar.js.map +1 -0
  63. package/dist/utils/index.d.ts +1 -0
  64. package/dist/utils/index.d.ts.map +1 -1
  65. package/dist/utils/index.js +1 -0
  66. package/dist/utils/index.js.map +1 -1
  67. package/index.css +32 -1
  68. package/package.json +3 -3
  69. package/src/components/alert/alert.stories.tsx +77 -0
  70. package/src/components/alert/alert.tsx +144 -0
  71. package/src/components/alert/index.ts +1 -0
  72. package/src/components/avatar/avatar-group.tsx +186 -0
  73. package/src/components/avatar/avatar.stories.tsx +172 -0
  74. package/src/components/avatar/avatar.tsx +215 -0
  75. package/src/components/avatar/index.ts +2 -0
  76. package/src/components/icon/custom/index.ts +1 -0
  77. package/src/components/icon/custom/shipfox-logo.tsx +20 -0
  78. package/src/components/icon/icon.tsx +11 -1
  79. package/src/components/index.ts +3 -0
  80. package/src/components/inline-tips/index.ts +1 -0
  81. package/src/components/inline-tips/inline-tips.stories.tsx +126 -0
  82. package/src/components/inline-tips/inline-tips.tsx +132 -0
  83. package/src/components/tooltip/tooltip.tsx +52 -0
  84. package/src/utils/avatar.ts +27 -0
  85. package/src/utils/index.ts +1 -0
@@ -1,5 +1,8 @@
1
+ export * from './alert/index.js';
2
+ export * from './avatar/index.js';
1
3
  export * from './button.js';
2
4
  export * from './icon/index.js';
5
+ export * from './inline-tips/index.js';
3
6
  export * from './textarea/index.js';
4
7
  export * from './theme-provider.js';
5
8
  export * from './typography/index.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './button';\nexport * from './icon';\nexport * from './textarea';\nexport * from './theme-provider';\nexport * from './typography';\n"],"names":[],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,eAAe"}
1
+ {"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["export * from './alert';\nexport * from './avatar';\nexport * from './button';\nexport * from './icon';\nexport * from './inline-tips';\nexport * from './textarea';\nexport * from './theme-provider';\nexport * from './typography';\n"],"names":[],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAC9B,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,eAAe"}
@@ -0,0 +1,2 @@
1
+ export * from './inline-tips';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/inline-tips/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './inline-tips.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/inline-tips/index.ts"],"sourcesContent":["export * from './inline-tips';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB"}
@@ -0,0 +1,19 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type { ComponentProps } from 'react';
3
+ declare const inlineTipsBaseVariants: (props?: ({
4
+ variant?: "primary" | "secondary" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ type InlineTipsProps = ComponentProps<'div'> & VariantProps<typeof inlineTipsBaseVariants> & {
7
+ type?: 'default' | 'info' | 'success' | 'destructive';
8
+ };
9
+ declare function InlineTips({ className, variant, type, children, ...props }: InlineTipsProps): import("react/jsx-runtime").JSX.Element;
10
+ declare function InlineTipsContent({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
11
+ declare function InlineTipsTitle({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
12
+ declare function InlineTipsDescription({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
13
+ declare function InlineTipsActions({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
14
+ declare const inlineTipsActionVariants: (props?: ({
15
+ variant?: "primary" | "secondary" | null | undefined;
16
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
+ declare function InlineTipsAction({ className, variant, ...props }: ComponentProps<'button'> & VariantProps<typeof inlineTipsActionVariants>): import("react/jsx-runtime").JSX.Element;
18
+ export { InlineTips, InlineTipsContent, InlineTipsTitle, InlineTipsDescription, InlineTipsActions, InlineTipsAction, };
19
+ //# sourceMappingURL=inline-tips.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-tips.d.ts","sourceRoot":"","sources":["../../../src/components/inline-t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"react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { cn } from '../../utils/cn.js';
4
+ const inlineTipsBaseVariants = cva('w-full text-sm flex gap-12 items-center', {
5
+ variants: {
6
+ variant: {
7
+ primary: 'bg-background-components-base text-foreground-neutral-base border border-border-neutral-base shadow-button-neutral rounded-8 px-12 py-8',
8
+ secondary: 'bg-transparent text-foreground-neutral-base'
9
+ }
10
+ },
11
+ defaultVariants: {
12
+ variant: 'primary'
13
+ }
14
+ });
15
+ const inlineTipsLineVariants = cva('w-4 self-stretch my-4 rounded-full', {
16
+ variants: {
17
+ type: {
18
+ default: 'bg-tag-neutral-icon',
19
+ info: 'bg-tag-warning-icon',
20
+ success: 'bg-tag-success-icon',
21
+ destructive: 'bg-tag-error-icon'
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ type: 'default'
26
+ }
27
+ });
28
+ function InlineTips({ className, variant, type = 'default', children, ...props }) {
29
+ return /*#__PURE__*/ _jsxs("div", {
30
+ "data-slot": "inline-tips",
31
+ className: cn(inlineTipsBaseVariants({
32
+ variant
33
+ }), className),
34
+ ...props,
35
+ children: [
36
+ /*#__PURE__*/ _jsx("div", {
37
+ "data-slot": "inline-tips-line",
38
+ className: cn(inlineTipsLineVariants({
39
+ type
40
+ })),
41
+ "aria-hidden": "true"
42
+ }),
43
+ children
44
+ ]
45
+ });
46
+ }
47
+ function InlineTipsContent({ className, ...props }) {
48
+ return /*#__PURE__*/ _jsx("div", {
49
+ "data-slot": "inline-tips-content",
50
+ className: cn('flex-1 min-w-0', className),
51
+ ...props
52
+ });
53
+ }
54
+ function InlineTipsTitle({ className, ...props }) {
55
+ return /*#__PURE__*/ _jsx("div", {
56
+ "data-slot": "inline-tips-title",
57
+ className: cn('font-medium text-sm leading-20 text-foreground-neutral-base mb-4', className),
58
+ ...props
59
+ });
60
+ }
61
+ function InlineTipsDescription({ className, ...props }) {
62
+ return /*#__PURE__*/ _jsx("div", {
63
+ "data-slot": "inline-tips-description",
64
+ className: cn('text-xs leading-20 text-foreground-neutral-muted [&_p]:leading-relaxed', className),
65
+ ...props
66
+ });
67
+ }
68
+ function InlineTipsActions({ className, ...props }) {
69
+ return /*#__PURE__*/ _jsx("div", {
70
+ "data-slot": "inline-tips-actions",
71
+ className: cn('flex items-center gap-8 shrink-0', className),
72
+ ...props
73
+ });
74
+ }
75
+ const inlineTipsActionVariants = cva('rounded-6 px-10 py-6 text-xs font-medium leading-20 transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-background-accent-blue-base focus-visible:ring-offset-2', {
76
+ variants: {
77
+ variant: {
78
+ primary: 'bg-background-button-inverted-default text-foreground-contrast-primary shadow-button-inverted hover:bg-background-button-inverted-hover active:bg-background-button-inverted-pressed focus-visible:shadow-button-inverted-focus disabled:bg-background-neutral-disabled disabled:text-foreground-neutral-disabled disabled:shadow-none ',
79
+ secondary: 'bg-background-button-neutral-default text-foreground-neutral-base shadow-button-neutral hover:bg-background-button-neutral-hover active:bg-background-button-neutral-pressed disabled:bg-background-neutral-disabled focus-visible:shadow-button-neutral-focus disabled:text-foreground-neutral-disabled disabled:shadow-none'
80
+ }
81
+ },
82
+ defaultVariants: {
83
+ variant: 'primary'
84
+ }
85
+ });
86
+ function InlineTipsAction({ className, variant, ...props }) {
87
+ return /*#__PURE__*/ _jsx("button", {
88
+ "data-slot": "inline-tips-action",
89
+ type: "button",
90
+ className: cn(inlineTipsActionVariants({
91
+ variant
92
+ }), className),
93
+ ...props
94
+ });
95
+ }
96
+ export { InlineTips, InlineTipsContent, InlineTipsTitle, InlineTipsDescription, InlineTipsActions, InlineTipsAction };
97
+
98
+ //# sourceMappingURL=inline-tips.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/inline-tips/inline-tips.tsx"],"sourcesContent":["import {cva, type VariantProps} from 'class-variance-authority';\nimport type {ComponentProps} from 'react';\nimport {cn} from 'utils/cn';\n\nconst inlineTipsBaseVariants = cva('w-full text-sm flex gap-12 items-center', {\n variants: {\n variant: {\n primary:\n 'bg-background-components-base text-foreground-neutral-base border border-border-neutral-base shadow-button-neutral rounded-8 px-12 py-8',\n secondary: 'bg-transparent text-foreground-neutral-base',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n});\n\nconst inlineTipsLineVariants = cva('w-4 self-stretch my-4 rounded-full', {\n variants: {\n type: {\n default: 'bg-tag-neutral-icon',\n info: 'bg-tag-warning-icon',\n success: 'bg-tag-success-icon',\n destructive: 'bg-tag-error-icon',\n },\n },\n defaultVariants: {\n type: 'default',\n },\n});\n\ntype InlineTipsProps = ComponentProps<'div'> &\n VariantProps<typeof inlineTipsBaseVariants> & {\n type?: 'default' | 'info' | 'success' | 'destructive';\n };\n\nfunction InlineTips({className, variant, type = 'default', children, ...props}: InlineTipsProps) {\n return (\n <div\n data-slot=\"inline-tips\"\n className={cn(inlineTipsBaseVariants({variant}), className)}\n {...props}\n >\n <div\n data-slot=\"inline-tips-line\"\n className={cn(inlineTipsLineVariants({type}))}\n aria-hidden=\"true\"\n />\n {children}\n </div>\n );\n}\n\nfunction InlineTipsContent({className, ...props}: ComponentProps<'div'>) {\n return (\n <div data-slot=\"inline-tips-content\" className={cn('flex-1 min-w-0', className)} {...props} />\n );\n}\n\nfunction InlineTipsTitle({className, ...props}: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"inline-tips-title\"\n className={cn('font-medium text-sm leading-20 text-foreground-neutral-base mb-4', className)}\n {...props}\n />\n );\n}\n\nfunction InlineTipsDescription({className, ...props}: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"inline-tips-description\"\n className={cn(\n 'text-xs leading-20 text-foreground-neutral-muted [&_p]:leading-relaxed',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction InlineTipsActions({className, ...props}: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"inline-tips-actions\"\n className={cn('flex items-center gap-8 shrink-0', className)}\n {...props}\n />\n );\n}\n\nconst inlineTipsActionVariants = cva(\n 'rounded-6 px-10 py-6 text-xs font-medium leading-20 transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-background-accent-blue-base focus-visible:ring-offset-2',\n {\n variants: {\n variant: {\n primary:\n 'bg-background-button-inverted-default text-foreground-contrast-primary shadow-button-inverted hover:bg-background-button-inverted-hover active:bg-background-button-inverted-pressed focus-visible:shadow-button-inverted-focus disabled:bg-background-neutral-disabled disabled:text-foreground-neutral-disabled disabled:shadow-none ',\n secondary:\n 'bg-background-button-neutral-default text-foreground-neutral-base shadow-button-neutral hover:bg-background-button-neutral-hover active:bg-background-button-neutral-pressed disabled:bg-background-neutral-disabled focus-visible:shadow-button-neutral-focus disabled:text-foreground-neutral-disabled disabled:shadow-none',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n },\n);\n\nfunction InlineTipsAction({\n className,\n variant,\n ...props\n}: ComponentProps<'button'> & VariantProps<typeof inlineTipsActionVariants>) {\n return (\n <button\n data-slot=\"inline-tips-action\"\n type=\"button\"\n className={cn(inlineTipsActionVariants({variant}), className)}\n {...props}\n />\n );\n}\n\nexport {\n InlineTips,\n InlineTipsContent,\n InlineTipsTitle,\n InlineTipsDescription,\n InlineTipsActions,\n InlineTipsAction,\n};\n"],"names":["cva","cn","inlineTipsBaseVariants","variants","variant","primary","secondary","defaultVariants","inlineTipsLineVariants","type","default","info","success","destructive","InlineTips","className","children","props","div","data-slot","aria-hidden","InlineTipsContent","InlineTipsTitle","InlineTipsDescription","InlineTipsActions","inlineTipsActionVariants","InlineTipsAction","button"],"mappings":";AAAA,SAAQA,GAAG,QAA0B,2BAA2B;AAEhE,SAAQC,EAAE,QAAO,WAAW;AAE5B,MAAMC,yBAAyBF,IAAI,2CAA2C;IAC5EG,UAAU;QACRC,SAAS;YACPC,SACE;YACFC,WAAW;QACb;IACF;IACAC,iBAAiB;QACfH,SAAS;IACX;AACF;AAEA,MAAMI,yBAAyBR,IAAI,sCAAsC;IACvEG,UAAU;QACRM,MAAM;YACJC,SAAS;YACTC,MAAM;YACNC,SAAS;YAC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AAEA,SACEH,UAAU,EACVO,iBAAiB,EACjBC,eAAe,EACfC,qBAAqB,EACrBC,iBAAiB,EACjBE,gBAAgB,GAChB"}
@@ -0,0 +1,214 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Code, Header } from '../../components/typography/index.js';
3
+ import { InlineTips, InlineTipsAction, InlineTipsActions, InlineTipsContent, InlineTipsDescription, InlineTipsTitle } from './inline-tips.js';
4
+ const meta = {
5
+ title: 'Components/InlineTips',
6
+ component: InlineTips,
7
+ tags: [
8
+ 'autodocs'
9
+ ],
10
+ argTypes: {
11
+ type: {
12
+ control: 'select',
13
+ options: [
14
+ 'default',
15
+ 'info',
16
+ 'success',
17
+ 'destructive'
18
+ ]
19
+ },
20
+ variant: {
21
+ control: 'select',
22
+ options: [
23
+ 'primary',
24
+ 'secondary'
25
+ ]
26
+ }
27
+ },
28
+ args: {
29
+ type: 'default',
30
+ variant: 'primary'
31
+ }
32
+ };
33
+ export default meta;
34
+ const types = [
35
+ 'default',
36
+ 'info',
37
+ 'success',
38
+ 'destructive'
39
+ ];
40
+ const variants = [
41
+ 'primary',
42
+ 'secondary'
43
+ ];
44
+ export const Default = {
45
+ render: (args)=>{
46
+ return /*#__PURE__*/ _jsxs(InlineTips, {
47
+ ...args,
48
+ children: [
49
+ /*#__PURE__*/ _jsxs(InlineTipsContent, {
50
+ children: [
51
+ /*#__PURE__*/ _jsx(InlineTipsTitle, {
52
+ children: "Title"
53
+ }),
54
+ /*#__PURE__*/ _jsx(InlineTipsDescription, {
55
+ children: "Description"
56
+ })
57
+ ]
58
+ }),
59
+ /*#__PURE__*/ _jsxs(InlineTipsActions, {
60
+ children: [
61
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
62
+ variant: args.variant,
63
+ children: "Label"
64
+ }),
65
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
66
+ variant: args.variant,
67
+ children: "Label"
68
+ })
69
+ ]
70
+ })
71
+ ]
72
+ });
73
+ }
74
+ };
75
+ export const Variants = {
76
+ render: ()=>{
77
+ return /*#__PURE__*/ _jsx("div", {
78
+ className: "flex flex-col gap-16",
79
+ children: variants.map((variant)=>/*#__PURE__*/ _jsxs(InlineTips, {
80
+ type: "default",
81
+ variant: variant,
82
+ children: [
83
+ /*#__PURE__*/ _jsxs(InlineTipsContent, {
84
+ children: [
85
+ /*#__PURE__*/ _jsx(InlineTipsTitle, {
86
+ children: "Title"
87
+ }),
88
+ /*#__PURE__*/ _jsx(InlineTipsDescription, {
89
+ children: "Description"
90
+ })
91
+ ]
92
+ }),
93
+ /*#__PURE__*/ _jsxs(InlineTipsActions, {
94
+ children: [
95
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
96
+ variant: "primary",
97
+ children: "Label"
98
+ }),
99
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
100
+ variant: "secondary",
101
+ children: "Label"
102
+ })
103
+ ]
104
+ })
105
+ ]
106
+ }, variant))
107
+ });
108
+ }
109
+ };
110
+ export const DesignMock = {
111
+ render: ()=>{
112
+ const content = {
113
+ default: {
114
+ title: 'Title',
115
+ description: 'Description'
116
+ },
117
+ info: {
118
+ title: 'Title',
119
+ description: 'Description'
120
+ },
121
+ success: {
122
+ title: 'Title',
123
+ description: 'Description'
124
+ },
125
+ destructive: {
126
+ title: "Don't's",
127
+ description: 'Title'
128
+ }
129
+ };
130
+ return /*#__PURE__*/ _jsxs("div", {
131
+ className: "flex flex-col gap-32 pb-64 pt-32 px-32 bg-background-neutral-base",
132
+ children: [
133
+ /*#__PURE__*/ _jsx(Header, {
134
+ variant: "h3",
135
+ className: "text-foreground-neutral-subtle",
136
+ children: "INLINE TIPS"
137
+ }),
138
+ /*#__PURE__*/ _jsxs("div", {
139
+ className: "flex flex-col gap-16",
140
+ children: [
141
+ /*#__PURE__*/ _jsx(Code, {
142
+ variant: "label",
143
+ className: "text-foreground-neutral-subtle",
144
+ children: "Primary"
145
+ }),
146
+ types.map((type)=>/*#__PURE__*/ _jsxs(InlineTips, {
147
+ type: type,
148
+ variant: "primary",
149
+ children: [
150
+ /*#__PURE__*/ _jsxs(InlineTipsContent, {
151
+ children: [
152
+ /*#__PURE__*/ _jsx(InlineTipsTitle, {
153
+ children: content[type].title
154
+ }),
155
+ /*#__PURE__*/ _jsx(InlineTipsDescription, {
156
+ children: content[type].description
157
+ })
158
+ ]
159
+ }),
160
+ /*#__PURE__*/ _jsxs(InlineTipsActions, {
161
+ children: [
162
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
163
+ variant: "primary",
164
+ children: "Label"
165
+ }),
166
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
167
+ variant: "secondary",
168
+ children: "Label"
169
+ })
170
+ ]
171
+ })
172
+ ]
173
+ }, type)),
174
+ /*#__PURE__*/ _jsx(Code, {
175
+ variant: "label",
176
+ className: "text-foreground-neutral-subtle",
177
+ children: "Secondary"
178
+ }),
179
+ types.map((type)=>/*#__PURE__*/ _jsxs(InlineTips, {
180
+ type: type,
181
+ variant: "secondary",
182
+ children: [
183
+ /*#__PURE__*/ _jsxs(InlineTipsContent, {
184
+ children: [
185
+ /*#__PURE__*/ _jsx(InlineTipsTitle, {
186
+ children: content[type].title
187
+ }),
188
+ /*#__PURE__*/ _jsx(InlineTipsDescription, {
189
+ children: content[type].description
190
+ })
191
+ ]
192
+ }),
193
+ /*#__PURE__*/ _jsxs(InlineTipsActions, {
194
+ children: [
195
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
196
+ variant: "primary",
197
+ children: "Label"
198
+ }),
199
+ /*#__PURE__*/ _jsx(InlineTipsAction, {
200
+ variant: "secondary",
201
+ children: "Label"
202
+ })
203
+ ]
204
+ })
205
+ ]
206
+ }, type))
207
+ ]
208
+ })
209
+ ]
210
+ });
211
+ }
212
+ };
213
+
214
+ //# sourceMappingURL=inline-tips.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/inline-tips/inline-tips.stories.tsx"],"sourcesContent":["import type {Meta, StoryObj} from '@storybook/react';\nimport {Code, Header} from 'components/typography';\nimport {\n InlineTips,\n InlineTipsAction,\n InlineTipsActions,\n InlineTipsContent,\n InlineTipsDescription,\n InlineTipsTitle,\n} from './inline-tips';\n\nconst meta = {\n title: 'Components/InlineTips',\n component: InlineTips,\n tags: ['autodocs'],\n argTypes: {\n type: {\n control: 'select',\n options: ['default', 'info', 'success', 'destructive'],\n },\n variant: {\n control: 'select',\n options: ['primary', 'secondary'],\n },\n },\n args: {\n type: 'default',\n variant: 'primary',\n },\n} satisfies Meta<typeof InlineTips>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst types = ['default', 'info', 'success', 'destructive'] as const;\nconst variants = ['primary', 'secondary'] as const;\n\nexport const Default: Story = {\n render: (args) => {\n return (\n <InlineTips {...args}>\n <InlineTipsContent>\n <InlineTipsTitle>Title</InlineTipsTitle>\n <InlineTipsDescription>Description</InlineTipsDescription>\n </InlineTipsContent>\n <InlineTipsActions>\n <InlineTipsAction variant={args.variant}>Label</InlineTipsAction>\n <InlineTipsAction variant={args.variant}>Label</InlineTipsAction>\n </InlineTipsActions>\n </InlineTips>\n );\n },\n};\n\nexport const Variants: Story = {\n render: () => {\n return (\n <div className=\"flex flex-col gap-16\">\n {variants.map((variant) => (\n <InlineTips key={variant} type=\"default\" variant={variant}>\n <InlineTipsContent>\n <InlineTipsTitle>Title</InlineTipsTitle>\n <InlineTipsDescription>Description</InlineTipsDescription>\n </InlineTipsContent>\n <InlineTipsActions>\n <InlineTipsAction variant=\"primary\">Label</InlineTipsAction>\n <InlineTipsAction variant=\"secondary\">Label</InlineTipsAction>\n </InlineTipsActions>\n </InlineTips>\n ))}\n </div>\n );\n },\n};\n\nexport const DesignMock: Story = {\n render: () => {\n const content = {\n default: {title: 'Title', description: 'Description'},\n info: {title: 'Title', description: 'Description'},\n success: {title: 'Title', description: 'Description'},\n destructive: {title: \"Don't's\", description: 'Title'},\n };\n\n return (\n <div className=\"flex flex-col gap-32 pb-64 pt-32 px-32 bg-background-neutral-base\">\n <Header variant=\"h3\" className=\"text-foreground-neutral-subtle\">\n INLINE TIPS\n </Header>\n <div className=\"flex flex-col gap-16\">\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Primary\n </Code>\n {types.map((type) => (\n <InlineTips key={type} type={type} variant=\"primary\">\n <InlineTipsContent>\n <InlineTipsTitle>{content[type].title}</InlineTipsTitle>\n <InlineTipsDescription>{content[type].description}</InlineTipsDescription>\n </InlineTipsContent>\n <InlineTipsActions>\n <InlineTipsAction variant=\"primary\">Label</InlineTipsAction>\n <InlineTipsAction variant=\"secondary\">Label</InlineTipsAction>\n </InlineTipsActions>\n </InlineTips>\n ))}\n <Code variant=\"label\" className=\"text-foreground-neutral-subtle\">\n Secondary\n </Code>\n {types.map((type) => (\n <InlineTips key={type} type={type} variant=\"secondary\">\n <InlineTipsContent>\n <InlineTipsTitle>{content[type].title}</InlineTipsTitle>\n <InlineTipsDescription>{content[type].description}</InlineTipsDescription>\n </InlineTipsContent>\n <InlineTipsActions>\n <InlineTipsAction variant=\"primary\">Label</InlineTipsAction>\n <InlineTipsAction variant=\"secondary\">Label</InlineTipsAction>\n </InlineTipsActions>\n </InlineTips>\n ))}\n </div>\n </div>\n );\n },\n};\n"],"names":["Code","Header","InlineTips","InlineTipsAction","InlineTipsActions","InlineTipsContent","InlineTipsDescription","InlineTipsTitle","meta","title","component","tags","argTypes","type","control","options","variant","args","types","variants","Default","render","Variants","div","className","map","DesignMock","content","default","description","info","success","destructive"],"mappings":";AACA,SAAQA,IAAI,EAAEC,MAAM,QAAO,wBAAwB;AACnD,SACEC,UAAU,EACVC,gBAAgB,EAChBC,iBAAiB,EACjBC,iBAAiB,EACjBC,qBAAqB,EACrBC,eAAe,QACV,gBAAgB;AAEvB,MAAMC,OAAO;IACXC,OAAO;IACPC,WAAWR;IACXS,MAAM;QAAC;KAAW;IAClBC,UAAU;QACRC,MAAM;YACJC,SAAS;YACTC,SAAS;gBAAC;gBAAW;gBAAQ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,WAAU;;sCACb,KAACxB;4BAAKgB,SAAQ;4BAAQQ,WAAU;sCAAiC;;wBAGhEN,MAAMO,GAAG,CAAC,CAACZ,qBACV,MAACX;gCAAsBW,MAAMA;gCAAMG,SAAQ;;kDACzC,MAACX;;0DACC,KAACE;0DAAiBoB,OAAO,CAACd,KAAK,CAACJ,KAAK;;0DACrC,KAACH;0DAAuBqB,OAAO,CAACd,KAAK,CAACgB,WAAW;;;;kDAEnD,MAACzB;;0DACC,KAACD;gDAAiBa,SAAQ;0DAAU;;0DACpC,KAACb;gDAAiBa,SAAQ;0DAAY;;;;;+BAPzBH;sCAWnB,KAACb;4BAAKgB,SAAQ;4BAAQQ,WAAU;sCAAiC;;wBAGhEN,MAAMO,GAAG,CAAC,CAACZ,qBACV,MAACX;gCAAsBW,MAAMA;gCAAMG,SAAQ;;kDACzC,MAACX;;0DACC,KAACE;0DAAiBoB,OAAO,CAACd,KAAK,CAACJ,KAAK;;0DACrC,KAACH;0DAAuBqB,OAAO,CAACd,KAAK,CAACgB,WAAW;;;;kDAEnD,MAACzB;;0DACC,KAACD;gDAAiBa,SAAQ;0DAAU;;0DACpC,KAACb;gDAAiBa,SAAQ;0DAAY;;;;;+BAPzBH;;;;;IAc3B;AACF,EAAE"}
@@ -0,0 +1,7 @@
1
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
+ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
7
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAG5D,iBAAS,eAAe,CAAC,EACvB,aAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,2CAQxD;AAED,iBAAS,OAAO,CAAC,EAAC,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAM9E;AAED,iBAAS,cAAc,CAAC,EAAC,GAAG,KAAK,EAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAExF;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,UAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAgBvD;AAED,OAAO,EAAC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
+ import { cn } from '../../utils/cn.js';
4
+ function TooltipProvider({ delayDuration = 0, ...props }) {
5
+ return /*#__PURE__*/ _jsx(TooltipPrimitive.Provider, {
6
+ "data-slot": "tooltip-provider",
7
+ delayDuration: delayDuration,
8
+ ...props
9
+ });
10
+ }
11
+ function Tooltip({ ...props }) {
12
+ return /*#__PURE__*/ _jsx(TooltipProvider, {
13
+ children: /*#__PURE__*/ _jsx(TooltipPrimitive.Root, {
14
+ "data-slot": "tooltip",
15
+ ...props
16
+ })
17
+ });
18
+ }
19
+ function TooltipTrigger({ ...props }) {
20
+ return /*#__PURE__*/ _jsx(TooltipPrimitive.Trigger, {
21
+ "data-slot": "tooltip-trigger",
22
+ ...props
23
+ });
24
+ }
25
+ function TooltipContent({ className, sideOffset = 0, children, ...props }) {
26
+ return /*#__PURE__*/ _jsx(TooltipPrimitive.Portal, {
27
+ children: /*#__PURE__*/ _jsx(TooltipPrimitive.Content, {
28
+ "data-slot": "tooltip-content",
29
+ sideOffset: sideOffset,
30
+ className: cn('rounded-8 bg-background-components-base text-foreground-neutral-base px-8 py-4 text-xs font-medium leading-20 shadow-button-neutral animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md text-balance', className),
31
+ ...props,
32
+ children: children
33
+ })
34
+ });
35
+ }
36
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
37
+
38
+ //# sourceMappingURL=tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport {cn} from 'utils/cn';\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({...props}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({...props}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'rounded-8 bg-background-components-base text-foreground-neutral-base px-8 py-4 text-xs font-medium leading-20 shadow-button-neutral animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md text-balance',\n className,\n )}\n {...props}\n >\n {children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport {Tooltip, TooltipTrigger, TooltipContent, TooltipProvider};\n"],"names":["TooltipPrimitive","cn","TooltipProvider","delayDuration","props","Provider","data-slot","Tooltip","Root","TooltipTrigger","Trigger","TooltipContent","className","sideOffset","children","Portal","Content"],"mappings":";AAAA,YAAYA,sBAAsB,0BAA0B;AAC5D,SAAQC,EAAE,QAAO,WAAW;AAE5B,SAASC,gBAAgB,EACvBC,gBAAgB,CAAC,EACjB,GAAGC,OACoD;IACvD,qBACE,KAACJ,iBAAiBK,QAAQ;QACxBC,aAAU;QACVH,eAAeA;QACd,GAAGC,KAAK;;AAGf;AAEA,SAASG,QAAQ,EAAC,GAAGH,OAA0D;IAC7E,qBACE,KAACF;kBACC,cAAA,KAACF,iBAAiBQ,IAAI;YAACF,aAAU;YAAW,GAAGF,KAAK;;;AAG1D;AAEA,SAASK,eAAe,EAAC,GAAGL,OAA6D;IACvF,qBAAO,KAACJ,iBAAiBU,OAAO;QAACJ,aAAU;QAAmB,GAAGF,KAAK;;AACxE;AAEA,SAASO,eAAe,EACtBC,SAAS,EACTC,aAAa,CAAC,EACdC,QAAQ,EACR,GAAGV,OACmD;IACtD,qBACE,KAACJ,iBAAiBe,MAAM;kBACtB,cAAA,KAACf,iBAAiBgB,OAAO;YACvBV,aAAU;YACVO,YAAYA;YACZD,WAAWX,GACT,ufACAW;YAED,GAAGR,KAAK;sBAERU;;;AAIT;AAEA,SAAQP,OAAO,EAAEE,cAAc,EAAEE,cAAc,EAAET,eAAe,GAAE"}
@@ -0,0 +1,3 @@
1
+ export declare const getPlaceholderImageUrl: (name?: string) => string;
2
+ export declare const getInitial: (name?: string) => string;
3
+ //# sourceMappingURL=avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/utils/avatar.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,KAAG,MAStD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAK1C,CAAC"}
@@ -0,0 +1,32 @@
1
+ const hashString = (str)=>{
2
+ let hash = 0;
3
+ for(let i = 0; i < str.length; i++){
4
+ const char = str.charCodeAt(i);
5
+ hash = (hash << 5) - hash + char;
6
+ hash = hash & hash;
7
+ }
8
+ return Math.abs(hash);
9
+ };
10
+ export const getPlaceholderImageUrl = (name)=>{
11
+ const backgroundColors = [
12
+ 'BFDFFF',
13
+ 'BFEAFF',
14
+ 'CFBFFF',
15
+ 'FFBFC3',
16
+ 'FFEABF',
17
+ 'E3E6EA',
18
+ 'EAEAEA'
19
+ ];
20
+ const seed = name?.trim() || 'avatar';
21
+ const colorIndex = hashString(seed) % backgroundColors.length;
22
+ const backgroundColor = backgroundColors[colorIndex];
23
+ return `https://api.dicebear.com/9.x/micah/svg?backgroundColor=${backgroundColor}&seed=${encodeURIComponent(seed)}`;
24
+ };
25
+ export const getInitial = (name)=>{
26
+ if (name) {
27
+ return name.trim()[0]?.toUpperCase() ?? 'L';
28
+ }
29
+ return 'L';
30
+ };
31
+
32
+ //# sourceMappingURL=avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/avatar.ts"],"sourcesContent":["const hashString = (str: string): number => {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return Math.abs(hash);\n};\n\nexport const getPlaceholderImageUrl = (name?: string): string => {\n const backgroundColors = ['BFDFFF', 'BFEAFF', 'CFBFFF', 'FFBFC3', 'FFEABF', 'E3E6EA', 'EAEAEA'];\n\n const seed = name?.trim() || 'avatar';\n\n const colorIndex = hashString(seed) % backgroundColors.length;\n const backgroundColor = backgroundColors[colorIndex];\n\n return `https://api.dicebear.com/9.x/micah/svg?backgroundColor=${backgroundColor}&seed=${encodeURIComponent(seed)}`;\n};\n\nexport const getInitial = (name?: string): string => {\n if (name) {\n return name.trim()[0]?.toUpperCase() ?? 'L';\n }\n return 'L';\n};\n"],"names":["hashString","str","hash","i","length","char","charCodeAt","Math","abs","getPlaceholderImageUrl","name","backgroundColors","seed","trim","colorIndex","backgroundColor","encodeURIComponent","getInitial","toUpperCase"],"mappings":"AAAA,MAAMA,aAAa,CAACC;IAClB,IAAIC,OAAO;IACX,IAAK,IAAIC,IAAI,GAAGA,IAAIF,IAAIG,MAAM,EAAED,IAAK;QACnC,MAAME,OAAOJ,IAAIK,UAAU,CAACH;QAC5BD,OAAO,AAACA,CAAAA,QAAQ,CAAA,IAAKA,OAAOG;QAC5BH,OAAOA,OAAOA;IAChB;IACA,OAAOK,KAAKC,GAAG,CAACN;AAClB;AAEA,OAAO,MAAMO,yBAAyB,CAACC;IACrC,MAAMC,mBAAmB;QAAC;QAAU;QAAU;QAAU;QAAU;QAAU;QAAU;KAAS;IAE/F,MAAMC,OAAOF,MAAMG,UAAU;IAE7B,MAAMC,aAAad,WAAWY,QAAQD,iBAAiBP,MAAM;IAC7D,MAAMW,kBAAkBJ,gBAAgB,CAACG,WAAW;IAEpD,OAAO,CAAC,uDAAuD,EAAEC,gBAAgB,MAAM,EAAEC,mBAAmBJ,OAAO;AACrH,EAAE;AAEF,OAAO,MAAMK,aAAa,CAACP;IACzB,IAAIA,MAAM;QACR,OAAOA,KAAKG,IAAI,EAAE,CAAC,EAAE,EAAEK,iBAAiB;IAC1C;IACA,OAAO;AACT,EAAE"}
@@ -1,3 +1,4 @@
1
+ export * from './avatar';
1
2
  export * from './clipboard';
2
3
  export * from './cn';
3
4
  export * from './date';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from './avatar.js';
1
2
  export * from './clipboard.js';
2
3
  export * from './cn.js';
3
4
  export * from './date.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './clipboard';\nexport * from './cn';\nexport * from './date';\nexport * from './format';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc,WAAW"}
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './avatar';\nexport * from './clipboard';\nexport * from './cn';\nexport * from './date';\nexport * from './format';\n"],"names":[],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc,WAAW"}
package/index.css CHANGED
@@ -290,6 +290,37 @@
290
290
  /* Alpha */
291
291
  --alpha-250: var(--color-alpha-black-10);
292
292
  --alpha-400: var(--color-alpha-black-24);
293
+
294
+ /* Shadow */
295
+ --shadow-border-base:
296
+ 0 -1px 0 0 var(--color-alpha-white-6), 0 0 0 1px var(--color-alpha-white-6), 0 0 0 1px
297
+ var(--color-neutral-800), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
298
+ var(--color-alpha-black-24);
299
+ --shadow-border-interactive-with-active: 0 0 0 1px #ff8b16, 0 0 0 4px rgba(255, 49, 0, 0.25);
300
+ --shadow-border-error: 0 0 0 1px #ff1f5a, 0 0 0 3px rgba(246, 0, 67, 0.25);
301
+ --shadow-button-inverted:
302
+ 0 -1px 0 0 var(--color-alpha-white-12), 0 0 0 1px var(--color-alpha-white-10), 0 0 0 1px
303
+ var(--color-neutral-600), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
304
+ var(--color-alpha-black-24);
305
+ --shadow-button-inverted-focus:
306
+ 0 -1px 0 0 var(--color-alpha-white-12), 0 0 0 1px var(--color-alpha-white-12), 0 0 0 1px
307
+ var(--color-neutral-600), 0 0 0 2px var(--color-alpha-white-88), 0 0 0 4px
308
+ var(--color-primary-500);
309
+ --shadow-button-neutral:
310
+ 0 -1px 0 0 var(--color-alpha-white-6), 0 0 0 1px var(--color-alpha-white-6), 0 0 0 1px
311
+ var(--color-neutral-800), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
312
+ var(--color-alpha-black-24);
313
+ --shadow-button-neutral-focus:
314
+ 0 -1px 0 0 var(--color-alpha-white-6), 0 0 0 1px var(--color-alpha-white-6), 0 0 0 1px
315
+ var(--color-neutral-800), 0 0 0 2px var(--color-alpha-white-88), 0 0 0 4px
316
+ var(--color-primary-500);
317
+ --shadow-button-danger:
318
+ 0 -1px 0 0 var(--color-alpha-white-16), 0 0 0 1px var(--color-alpha-white-12), 0 0 0 1px
319
+ var(--color-red-700), 0 0 1px 1.5px var(--color-alpha-black-24), 0 2px 2px 0
320
+ var(--color-alpha-black-24);
321
+ --shadow-button-danger-focus:
322
+ 0 -1px 0 0 var(--color-alpha-white-16), 0 0 0 1px var(--color-alpha-white-12), 0 0 0 1px
323
+ var(--color-red-700), 0 0 0 2px var(--color-alpha-white-88), 0 0 0 4px var(--color-primary-500);
293
324
  }
294
325
 
295
326
  .dark {
@@ -307,7 +338,7 @@
307
338
  --background-highlight-base: var(--color-primary-950);
308
339
  --background-neutral-hover: var(--color-neutral-800);
309
340
  --background-neutral-overlay: var(--color-neutral-800);
310
- --background-components-base: var(--color-neutral-900);
341
+ --background-components-base: var(--color-neutral-800);
311
342
  --background-field-component: var(--color-neutral-900);
312
343
  --background-switch-off-hover: var(--color-neutral-600);
313
344
  --background-field-component-hover: var(--color-neutral-800);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/react-ui",
3
3
  "license": "MIT",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "storybook-addon-pseudo-states": "^9.1.8",
57
57
  "tailwindcss": "^4.1.13",
58
58
  "tw-animate-css": "^1.4.0",
59
- "@shipfox/biome": "1.2.2",
59
+ "@shipfox/biome": "1.3.0",
60
60
  "@shipfox/swc": "1.2.1",
61
61
  "@shipfox/ts-config": "1.3.5",
62
62
  "@shipfox/typescript": "1.1.2",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "scripts": {
67
67
  "build": "swc",
68
- "check": "biome",
68
+ "check": "biome-check",
69
69
  "storybook": "storybook dev",
70
70
  "storybook:build": "storybook build -o storybook-static",
71
71
  "test": "vitest-run",