@local-logic/design-system 0.7.7 → 0.7.9

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.
@@ -1,5 +1,4 @@
1
1
  import { default as React, HTMLAttributes } from 'react';
2
-
3
2
  import * as icons from "../../assets";
4
3
  export type IconName = keyof typeof icons;
5
4
  export interface Props extends HTMLAttributes<HTMLDivElement> {
@@ -1,7 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { IconName } from '../../index';
3
3
  import { Props as IconProps } from '../Icon';
4
-
5
4
  export declare const argTypes: {
6
5
  icons: {
7
6
  control: boolean;
@@ -1,6 +1,5 @@
1
1
  import { Meta } from '@storybook/react';
2
2
  import { Icon, IconName } from '../../index';
3
-
4
3
  declare const _default: Meta<typeof Icon>;
5
4
  export default _default;
6
5
  export declare const Arrows: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, {
@@ -1,4 +1,3 @@
1
1
  import { IconName } from '../../../index';
2
-
3
2
  export declare const icons: IconName[];
4
3
  //# sourceMappingURL=arrows.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './icons';
2
+ export * from './ui';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface ButtonProps {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ variant?: "primary" | "secondary" | "ghost";
6
+ size?: "small" | "medium" | "large";
7
+ Icon?: React.ElementType;
8
+ inverse?: boolean;
9
+ isDisabled?: boolean;
10
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
11
+ }
12
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IAC5C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,MAAM,uFAkClB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { Meta } from '@storybook/react';
3
+ import { Button } from './index';
4
+ declare const _default: Meta<typeof Button>;
5
+ export default _default;
6
+ export declare const All: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./index').ButtonProps & React.RefAttributes<HTMLButtonElement>>;
7
+ export declare const Primary: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./index').ButtonProps & React.RefAttributes<HTMLButtonElement>>;
8
+ export declare const Secondary: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./index').ButtonProps & React.RefAttributes<HTMLButtonElement>>;
9
+ export declare const Ghost: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./index').ButtonProps & React.RefAttributes<HTMLButtonElement>>;
10
+ export declare const PrimaryIcon: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./index').ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export declare const SecondaryIcon: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./index').ButtonProps & React.RefAttributes<HTMLButtonElement>>;
12
+ export declare const GhostIcon: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./index').ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
+ //# sourceMappingURL=index.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.stories.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Button/index.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;wBAsB5B,IAAI,CAAC,OAAO,MAAM,CAAC;AApBxB,wBAoByB;AAIzB,eAAO,MAAM,GAAG,6JAAoB,CAAC;AAiDrC,eAAO,MAAM,OAAO,6JAAoB,CAAC;AAQzC,eAAO,MAAM,SAAS,6JAAoB,CAAC;AAQ3C,eAAO,MAAM,KAAK,6JAAoB,CAAC;AASvC,eAAO,MAAM,WAAW,6JAAoB,CAAC;AAS7C,eAAO,MAAM,aAAa,6JAAoB,CAAC;AAS/C,eAAO,MAAM,SAAS,6JAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const button = "\n group bg-transparent justify-center\n text-lg font-medium no-underline\n px-5 py-0 rounded-xl h-11\n flex items-center gap-2 cursor-pointer\n transition-all min-w-fit\n\n outline-none border-none\n disabled:pointer-events-none\n data-[is-disabled=true]:pointer-events-none\n\n data-[size=\"medium\"]:h-12\n data-[size=\"large\"]:h-16\n\n data-[variant=\"primary\"]:bg-primary-100\n data-[variant=\"primary\"]:text-white\n data-[variant=\"primary\"]:hover:bg-primary-200\n data-[variant=\"primary\"]:disabled:bg-gray-250\n data-[variant=\"primary\"]:data-[is-disabled=true]:bg-gray-250\n data-[variant=\"primary\"]:data-[inverse=true]:bg-white\n data-[variant=\"primary\"]:data-[inverse=true]:text-primary-100\n data-[variant=\"primary\"]:data-[inverse=true]:hover:bg-white\n data-[variant=\"primary\"]:data-[inverse=true]:hover:text-primary-200\n data-[variant=\"primary\"]:data-[inverse=true]:disabled:bg-gray-200\n data-[variant=\"primary\"]:data-[inverse=true]:disabled:text-white\n data-[variant=\"primary\"]:data-[inverse=true]:data-[is-disabled=true]:bg-gray-200\n data-[variant=\"primary\"]:data-[inverse=true]:data-[is-disabled=true]:text-white\n\n data-[variant=\"secondary\"]:border\n data-[variant=\"secondary\"]:border-solid\n data-[variant=\"secondary\"]:border-gray-150\n data-[variant=\"secondary\"]:text-primary-100\n data-[variant=\"secondary\"]:hover:border-primary-50\n data-[variant=\"secondary\"]:hover:text-primary-50\n data-[variant=\"secondary\"]:disabled:text-gray-250\n data-[variant=\"secondary\"]:disabled:border-gray-250\n data-[variant=\"secondary\"]:data-[is-disabled=true]:text-gray-250\n data-[variant=\"secondary\"]:data-[is-disabled=true]:border-gray-250\n data-[variant=\"secondary\"]:data-[inverse=true]:text-white\n data-[variant=\"secondary\"]:data-[inverse=true]:border-white\n\n data-[variant=\"ghost\"]:text-primary-100\n data-[variant=\"ghost\"]:hover:text-primary-50\n data-[variant=\"ghost\"]:disabled:text-gray-250\n data-[variant=\"ghost\"]:data-[is-disabled=true]:text-gray-250\n\n data-[variant=\"ghost\"]:data-[inverse=true]:text-white\n";
2
+ export declare const icon = "h-6 w-6";
3
+ export declare const arrow = "h-3 w-3 text-black";
4
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Button/styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,ulEA+ClB,CAAC;AAEF,eAAO,MAAM,IAAI,YAAY,CAAC;AAE9B,eAAO,MAAM,KAAK,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './components/Button/index';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.tsx"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,185 @@
1
+ import { jsxs as Z, jsx as u } from "react/jsx-runtime";
2
+ import t, { createContext as $, forwardRef as x, useContext as B } from "react";
3
+ const F = /* @__PURE__ */ new Map([
4
+ [
5
+ "bold",
6
+ /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("path", { d: "M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z" }))
7
+ ],
8
+ [
9
+ "duotone",
10
+ /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }), /* @__PURE__ */ t.createElement("path", { d: "M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z" }))
11
+ ],
12
+ [
13
+ "fill",
14
+ /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("path", { d: "M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z" }))
15
+ ],
16
+ [
17
+ "light",
18
+ /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("path", { d: "M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z" }))
19
+ ],
20
+ [
21
+ "regular",
22
+ /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" }))
23
+ ],
24
+ [
25
+ "thin",
26
+ /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("path", { d: "M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z" }))
27
+ ]
28
+ ]), N = $({
29
+ color: "currentColor",
30
+ size: "1em",
31
+ weight: "regular",
32
+ mirrored: !1
33
+ });
34
+ var L = Object.defineProperty, s = Object.getOwnPropertySymbols, E = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable, g = (e, a, r) => a in e ? L(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r, b = (e, a) => {
35
+ for (var r in a || (a = {}))
36
+ E.call(a, r) && g(e, r, a[r]);
37
+ if (s)
38
+ for (var r of s(a))
39
+ O.call(a, r) && g(e, r, a[r]);
40
+ return e;
41
+ }, h = (e, a) => {
42
+ var r = {};
43
+ for (var i in e)
44
+ E.call(e, i) && a.indexOf(i) < 0 && (r[i] = e[i]);
45
+ if (e != null && s)
46
+ for (var i of s(e))
47
+ a.indexOf(i) < 0 && O.call(e, i) && (r[i] = e[i]);
48
+ return r;
49
+ };
50
+ const j = x((e, a) => {
51
+ const r = e, {
52
+ alt: i,
53
+ color: n,
54
+ size: l,
55
+ weight: d,
56
+ mirrored: o,
57
+ children: m,
58
+ weights: v
59
+ } = r, c = h(r, [
60
+ "alt",
61
+ "color",
62
+ "size",
63
+ "weight",
64
+ "mirrored",
65
+ "children",
66
+ "weights"
67
+ ]), p = B(N), {
68
+ color: z = "currentColor",
69
+ size: y,
70
+ weight: A = "regular",
71
+ mirrored: C = !1
72
+ } = p, P = h(p, [
73
+ "color",
74
+ "size",
75
+ "weight",
76
+ "mirrored"
77
+ ]);
78
+ return /* @__PURE__ */ t.createElement(
79
+ "svg",
80
+ b(b({
81
+ ref: a,
82
+ xmlns: "http://www.w3.org/2000/svg",
83
+ width: l ?? y,
84
+ height: l ?? y,
85
+ fill: n ?? z,
86
+ viewBox: "0 0 256 256",
87
+ transform: o || C ? "scale(-1, 1)" : void 0
88
+ }, P), c),
89
+ !!i && /* @__PURE__ */ t.createElement("title", null, i),
90
+ m,
91
+ v.get(d ?? A)
92
+ );
93
+ });
94
+ j.displayName = "IconBase";
95
+ const R = j;
96
+ var V = Object.defineProperty, k = Object.defineProperties, I = Object.getOwnPropertyDescriptors, f = Object.getOwnPropertySymbols, S = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable, w = (e, a, r) => a in e ? V(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r, D = (e, a) => {
97
+ for (var r in a || (a = {}))
98
+ S.call(a, r) && w(e, r, a[r]);
99
+ if (f)
100
+ for (var r of f(a))
101
+ _.call(a, r) && w(e, r, a[r]);
102
+ return e;
103
+ }, q = (e, a) => k(e, I(a));
104
+ const M = x((e, a) => /* @__PURE__ */ t.createElement(R, q(D({ ref: a }, e), { weights: F })));
105
+ M.displayName = "CaretRight";
106
+ const G = `
107
+ group bg-transparent justify-center
108
+ text-lg font-medium no-underline
109
+ px-5 py-0 rounded-xl h-11
110
+ flex items-center gap-2 cursor-pointer
111
+ transition-all min-w-fit
112
+
113
+ outline-none border-none
114
+ disabled:pointer-events-none
115
+ data-[is-disabled=true]:pointer-events-none
116
+
117
+ data-[size="medium"]:h-12
118
+ data-[size="large"]:h-16
119
+
120
+ data-[variant="primary"]:bg-primary-100
121
+ data-[variant="primary"]:text-white
122
+ data-[variant="primary"]:hover:bg-primary-200
123
+ data-[variant="primary"]:disabled:bg-gray-250
124
+ data-[variant="primary"]:data-[is-disabled=true]:bg-gray-250
125
+ data-[variant="primary"]:data-[inverse=true]:bg-white
126
+ data-[variant="primary"]:data-[inverse=true]:text-primary-100
127
+ data-[variant="primary"]:data-[inverse=true]:hover:bg-white
128
+ data-[variant="primary"]:data-[inverse=true]:hover:text-primary-200
129
+ data-[variant="primary"]:data-[inverse=true]:disabled:bg-gray-200
130
+ data-[variant="primary"]:data-[inverse=true]:disabled:text-white
131
+ data-[variant="primary"]:data-[inverse=true]:data-[is-disabled=true]:bg-gray-200
132
+ data-[variant="primary"]:data-[inverse=true]:data-[is-disabled=true]:text-white
133
+
134
+ data-[variant="secondary"]:border
135
+ data-[variant="secondary"]:border-solid
136
+ data-[variant="secondary"]:border-gray-150
137
+ data-[variant="secondary"]:text-primary-100
138
+ data-[variant="secondary"]:hover:border-primary-50
139
+ data-[variant="secondary"]:hover:text-primary-50
140
+ data-[variant="secondary"]:disabled:text-gray-250
141
+ data-[variant="secondary"]:disabled:border-gray-250
142
+ data-[variant="secondary"]:data-[is-disabled=true]:text-gray-250
143
+ data-[variant="secondary"]:data-[is-disabled=true]:border-gray-250
144
+ data-[variant="secondary"]:data-[inverse=true]:text-white
145
+ data-[variant="secondary"]:data-[inverse=true]:border-white
146
+
147
+ data-[variant="ghost"]:text-primary-100
148
+ data-[variant="ghost"]:hover:text-primary-50
149
+ data-[variant="ghost"]:disabled:text-gray-250
150
+ data-[variant="ghost"]:data-[is-disabled=true]:text-gray-250
151
+
152
+ data-[variant="ghost"]:data-[inverse=true]:text-white
153
+ `, H = "h-6 w-6", J = "h-3 w-3 text-black", K = t.forwardRef(
154
+ ({
155
+ children: e,
156
+ className: a = "",
157
+ variant: r = "primary",
158
+ size: i = "small",
159
+ Icon: n,
160
+ isDisabled: l = !1,
161
+ inverse: d = !1,
162
+ onClick: o
163
+ }, m) => /* @__PURE__ */ Z(
164
+ "button",
165
+ {
166
+ onClick: (c) => {
167
+ o && o(c);
168
+ },
169
+ className: `${G} ${a}`,
170
+ disabled: l,
171
+ "data-variant": r,
172
+ "data-size": i,
173
+ "data-inverse": d,
174
+ children: [
175
+ n && /* @__PURE__ */ u(n, { className: H }),
176
+ e,
177
+ n && r === "ghost" && /* @__PURE__ */ u(M, { className: J })
178
+ ]
179
+ }
180
+ )
181
+ );
182
+ K.displayName = "Button";
183
+ export {
184
+ K as Button
185
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@local-logic/design-system",
3
- "version": "0.7.7",
3
+ "version": "0.7.9",
4
4
  "author": "Local Logic",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -55,43 +55,44 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@local-logic/eslint-config": "*",
58
- "@storybook/addon-actions": "^8.1.5",
59
- "@storybook/addon-essentials": "^8.1.5",
60
- "@storybook/addon-interactions": "^8.1.5",
61
- "@storybook/addon-links": "^8.1.5",
62
- "@storybook/addon-themes": "^8.1.5",
63
- "@storybook/blocks": "^8.1.5",
64
- "@storybook/builder-vite": "^8.1.5",
65
- "@storybook/react": "^8.1.5",
66
- "@storybook/react-vite": "^8.1.5",
58
+ "@storybook/addon-actions": "^8.3.6",
59
+ "@storybook/addon-essentials": "^8.3.6",
60
+ "@storybook/addon-interactions": "^8.3.6",
61
+ "@storybook/addon-links": "^8.3.6",
62
+ "@storybook/addon-themes": "^8.3.6",
63
+ "@storybook/blocks": "^8.3.6",
64
+ "@storybook/builder-vite": "^8.3.6",
65
+ "@storybook/react": "^8.3.6",
66
+ "@storybook/react-vite": "^8.3.6",
67
67
  "@storybook/testing-library": "^0.2.2",
68
- "@types/react": "^18.3.3",
69
- "@types/react-dom": "^18.3.0",
70
- "@typescript-eslint/eslint-plugin": "^7.7.1",
71
- "@typescript-eslint/parser": "^7.7.1",
72
- "@vitejs/plugin-react": "^4.2.1",
73
- "autoprefixer": "^10.4.19",
74
- "eslint": "^8.57.0",
75
- "eslint-plugin-html": "^8.1.1",
76
- "eslint-plugin-import": "^2.29.1",
68
+ "@types/react": "^18.3.12",
69
+ "@types/react-dom": "^18.3.1",
70
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
71
+ "@typescript-eslint/parser": "^7.18.0",
72
+ "@vitejs/plugin-react": "^4.3.3",
73
+ "autoprefixer": "^10.4.20",
74
+ "eslint": "^8.57.1",
75
+ "eslint-plugin-html": "^8.1.2",
76
+ "eslint-plugin-import": "^2.31.0",
77
77
  "eslint-plugin-storybook": "^0.8.0",
78
78
  "jestconfig": "*",
79
- "postcss": "^8.4.38",
80
- "prettier": "^3.3.0",
79
+ "postcss": "^8.4.47",
80
+ "prettier": "^3.3.3",
81
81
  "react": "^18.3.1",
82
82
  "react-dom": "^18.3.1",
83
83
  "rollup-plugin-visualizer": "^5.12.0",
84
- "storybook": "^8.0.9",
85
- "tailwindcss": "^3.4.3",
84
+ "storybook": "^8.3.6",
85
+ "tailwindcss": "^3.4.14",
86
86
  "tsconfig": "*",
87
87
  "tsconfig-paths-webpack-plugin": "^4.1.0",
88
- "typescript": "^5.4.5",
89
- "vite": "^5.4.6",
90
- "vite-plugin-dts": "^3.9.1",
88
+ "typescript": "^5.6.3",
89
+ "vite": "^5.4.10",
90
+ "vite-plugin-dts": "^4.3.0",
91
91
  "vite-plugin-svgr": "^4.2.0",
92
- "vitest": "^1.6.0"
92
+ "vitest": "^2.1.3"
93
93
  },
94
94
  "dependencies": {
95
- "glob": "^10.4.1"
95
+ "@phosphor-icons/react": "^2.1.7",
96
+ "glob": "^11.0.0"
96
97
  }
97
98
  }