@reshape-biotech/design-system 0.0.21 → 0.0.23

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.
@@ -4,7 +4,7 @@
4
4
  import { defineMeta } from '@storybook/addon-svelte-csf';
5
5
  const { Story } = defineMeta({
6
6
  component: Tooltip,
7
- title: 'Something/Tooltip',
7
+ title: 'Design System/Tooltip',
8
8
  tags: ['autodocs']
9
9
  });
10
10
  </script>
@@ -0,0 +1,14 @@
1
+ export const textColors: string[];
2
+ export const iconColors: string[];
3
+ export const backgroundColors: string[];
4
+ export const borders: string[];
5
+ export const shadows: string[];
6
+ export const textSizes: string[];
7
+ export const fonts: string[];
8
+ export const badges: string[];
9
+ export const tooltips: string[];
10
+ export const sizes: string[];
11
+ export const display: string[];
12
+ export const rounded: string[];
13
+ export const tables: string[];
14
+ export const safelist: string[];
@@ -0,0 +1,148 @@
1
+ // Used to safelist classnames so we can add styles dynamic.
2
+ // This should include all the values used in the design system.
3
+ // Read more here: https://daisyui.com/blog/most-common-mistake-when-using-tailwind-css/
4
+
5
+ export const textColors = [
6
+ 'text-primary',
7
+ 'text-primary-inverse',
8
+ 'text-secondary',
9
+ 'text-secondary-inverse',
10
+ 'text-tertiary',
11
+ 'text-tertiary-inverse',
12
+ 'text-accent',
13
+ 'text-success',
14
+ 'text-warning',
15
+ 'text-danger'
16
+ ];
17
+
18
+ export const iconColors = [
19
+ 'text-icon-primary',
20
+ 'text-icon-primary-inverse',
21
+ 'text-icon-secondary',
22
+ 'text-icon-tertiary',
23
+ 'text-icon-accent',
24
+ 'text-icon-success',
25
+ 'text-icon-warning',
26
+ 'text-icon-danger',
27
+ 'text-icon-blue',
28
+ 'text-icon-orange',
29
+ 'text-icon-sky'
30
+ ];
31
+
32
+ export const backgroundColors = [
33
+ 'bg-surface',
34
+ 'bg-surface-secondary',
35
+ 'bg-base',
36
+ 'bg-base-inverse',
37
+ 'bg-neutral',
38
+ 'bg-neutral-hover',
39
+ 'bg-neutral-darker',
40
+ 'bg-neutral-darker-hover',
41
+ 'bg-neutral-inverse',
42
+ 'bg-neutral-inverse-hover',
43
+ 'bg-accent',
44
+ 'bg-accent-hover',
45
+ 'bg-accent-inverse',
46
+ 'bg-accent-inverse-hover',
47
+ 'bg-success',
48
+ 'bg-success-hover',
49
+ 'bg-success-inverse',
50
+ 'bg-success-inverse-hover',
51
+ 'bg-warning',
52
+ 'bg-warning-hover',
53
+ 'bg-warning-inverse',
54
+ 'bg-warning-inverse-hover',
55
+ 'bg-danger',
56
+ 'bg-danger-hover',
57
+ 'bg-danger-inverse',
58
+ 'bg-danger-inverse-hover',
59
+ 'bg-blue',
60
+ 'bg-blue-hover',
61
+ 'bg-orange',
62
+ 'bg-orange-hover',
63
+ 'bg-orange-inverse',
64
+ 'bg-orange-inverse-hover',
65
+ 'bg-sky',
66
+ 'bg-sky-hover',
67
+ 'bg-sky-inverse',
68
+ 'bg-sky-inverse-hover'
69
+ ];
70
+
71
+ export const borders = [
72
+ 'border-static',
73
+ 'border-interactive',
74
+ 'border-hover',
75
+ 'border-focus',
76
+ 'border-danger'
77
+ ];
78
+
79
+ export const shadows = [
80
+ 'shadow',
81
+ 'shadow-none',
82
+ 'shadow-field',
83
+ 'shadow-nav',
84
+ 'shadow-calendar',
85
+ 'shadow-container',
86
+ 'shadow-panel',
87
+ 'shadow-outline',
88
+ 'shadow-focus'
89
+ ];
90
+
91
+ export const textSizes = [
92
+ 'text-xxs',
93
+ 'text-xs',
94
+ 'text-sm',
95
+ 'text-md',
96
+ 'text-lg',
97
+ 'text-xl',
98
+ 'text-2xl',
99
+ 'text-3xl',
100
+ 'text-4xl'
101
+ ];
102
+
103
+ export const fonts = ['font-medium', 'font-semibold', 'font-bold'];
104
+
105
+ export const badges = [
106
+ 'badge-neutral',
107
+ 'badge-success',
108
+ 'badge-warning',
109
+ 'badge-progress',
110
+ 'badge-error',
111
+ 'badge-md',
112
+ 'badge-sm'
113
+ ];
114
+
115
+ export const tooltips = ['tooltip-top', 'tooltip-right', 'tooltip-bottom', 'tooltip-left'];
116
+
117
+ export const sizes = ['h-5', 'w-5', 'min-w-5', 'h-7', 'w-7', 'min-w-7'];
118
+
119
+ export const display = [
120
+ 'flex',
121
+ 'items-center',
122
+ 'justify-center',
123
+ 'flex-row',
124
+ 'flex-col',
125
+ 'px-2',
126
+ 'py-1'
127
+ ];
128
+
129
+ export const rounded = ['rounded-full', 'rounded'];
130
+
131
+ export const tables = ['table-fixed', 'table-auto'];
132
+
133
+ // Export all arrays as a single safelist
134
+ export const safelist = [
135
+ ...textColors,
136
+ ...iconColors,
137
+ ...backgroundColors,
138
+ ...borders,
139
+ ...shadows,
140
+ ...textSizes,
141
+ ...fonts,
142
+ ...badges,
143
+ ...tooltips,
144
+ ...sizes,
145
+ ...display,
146
+ ...rounded,
147
+ ...tables
148
+ ];
@@ -1,5 +1,6 @@
1
1
  import typography from '@tailwindcss/typography';
2
2
  declare const config: {
3
+ safelist: string[];
3
4
  theme: {
4
5
  extend: {
5
6
  colors: {
@@ -3,6 +3,7 @@ import typography from '@tailwindcss/typography';
3
3
  import containerQueries from '@tailwindcss/container-queries';
4
4
  import { backgroundColor, borderColor, boxShadow, colors, textColor } from './tokens.js';
5
5
  const config = {
6
+ safelist: ['tailwind-safelist.txt'],
6
7
  theme: {
7
8
  extend: {
8
9
  colors,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reshape-biotech/design-system",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
@@ -36,7 +36,8 @@
36
36
  },
37
37
  "./tokens": "./dist/tokens.js",
38
38
  "./styles": "./dist/app.css",
39
- "./tailwind": "./dist/tailwind.preset.js"
39
+ "./tailwind": "./dist/tailwind.preset.js",
40
+ "./tailwind-safelist": "./dist/tailwind-safelist.js"
40
41
  },
41
42
  "peerDependencies": {
42
43
  "svelte": "^5.0.0",
@@ -44,15 +45,7 @@
44
45
  "daisyui": "^4.10.5"
45
46
  },
46
47
  "devDependencies": {
47
- "@chromatic-com/storybook": "^3.2.2",
48
48
  "@eslint/compat": "^1.2.3",
49
- "@storybook/addon-essentials": "^8.4.7",
50
- "@storybook/addon-interactions": "^8.4.7",
51
- "@storybook/addon-svelte-csf": "^5.0.0-next.11",
52
- "@storybook/blocks": "^8.4.7",
53
- "@storybook/svelte": "^8.4.7",
54
- "@storybook/sveltekit": "^8.4.7",
55
- "@storybook/test": "^8.4.7",
56
49
  "@sveltejs/adapter-vercel": "^5.5.0",
57
50
  "@sveltejs/kit": "^2.9.0",
58
51
  "@sveltejs/package": "^2.0.0",
@@ -71,7 +64,6 @@
71
64
  "prettier-plugin-svelte": "^3.2.6",
72
65
  "prettier-plugin-tailwindcss": "^0.6.5",
73
66
  "publint": "^0.2.0",
74
- "storybook": "^8.4.7",
75
67
  "svelte": "^5.0.0",
76
68
  "svelte-check": "^4.0.0",
77
69
  "tailwindcss": "^3.4.9",