@speckle/tailwind-theme 2.12.666

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/.eslintrc.cjs ADDED
@@ -0,0 +1,54 @@
1
+ const mainExtends = ['eslint:recommended', 'prettier']
2
+
3
+ /** @type {import("eslint").Linter.Config} */
4
+ const config = {
5
+ env: {
6
+ node: true
7
+ },
8
+ extends: [...mainExtends],
9
+ parserOptions: {
10
+ ecmaVersion: 2022,
11
+ sourceType: 'module'
12
+ },
13
+ overrides: [
14
+ {
15
+ files: '*.ts',
16
+ extends: ['plugin:@typescript-eslint/recommended', ...mainExtends],
17
+ rules: {
18
+ '@typescript-eslint/no-explicit-any': ['error'],
19
+ '@typescript-eslint/no-unsafe-argument': ['error'],
20
+ '@typescript-eslint/no-unsafe-assignment': 'error',
21
+ '@typescript-eslint/no-unsafe-call': 'error',
22
+ '@typescript-eslint/no-unsafe-member-access': 'error',
23
+ '@typescript-eslint/no-unsafe-return': 'error',
24
+ '@typescript-eslint/no-for-in-array': ['error'],
25
+ '@typescript-eslint/restrict-template-expressions': ['error'],
26
+ '@typescript-eslint/restrict-plus-operands': ['error'],
27
+ '@typescript-eslint/await-thenable': ['warn'],
28
+ '@typescript-eslint/ban-types': ['warn'],
29
+ 'require-await': 'off',
30
+ '@typescript-eslint/require-await': 'error',
31
+ 'no-undef': 'off'
32
+ },
33
+ parserOptions: {
34
+ ecmaVersion: 2022,
35
+ sourceType: 'module',
36
+ parser: '@typescript-eslint/parser',
37
+ tsconfigRootDir: __dirname,
38
+ project: ['./tsconfig.json']
39
+ },
40
+ plugins: ['@typescript-eslint']
41
+ },
42
+ {
43
+ files: '*.d.ts',
44
+ rules: {
45
+ 'no-var': 'off',
46
+ '@typescript-eslint/no-explicit-any': 'off',
47
+ '@typescript-eslint/ban-types': 'off',
48
+ 'no-unused-vars': 'off'
49
+ }
50
+ }
51
+ ]
52
+ }
53
+
54
+ module.exports = config
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # tailwind-theme
2
+
3
+ Tailwind theme used in frontend 2 and other apps.
4
+
5
+ ## Setup
6
+
7
+ 1. Install the package
8
+ 1. In your tailwind config import `@speckle/tailwind-theme` and `@tailwindcss/forms` and add them to your `plugins` array
9
+ 1. Import `tailwindContentEntry` from `@speckle/tailwind-theme/tailwind-configure` and invoke it in the `contents` field in your Tailwind config to ensure PurgeCSS is configured correctly. It requires the CJS `require` object as its only parameter. If it isn't available (in an ESM environment), you can use node's `createRequire()`.
10
+
11
+ ## Development
12
+
13
+ 1. Link this repo to wherever you're using this package. Unnecessary if you're using this package somewhere inside this monorepo.
14
+ 1. Run `yarn build` to re-build
15
+
16
+ ## Viewer
17
+
18
+ Run `yarn viewer` to open the Tailwind Config Viewer in the browser.
19
+
20
+ **Note 1:** The project must be built first for this to work!
21
+ **Note 2:** All of the custom colors that rely on CSS variables will only show the light mode version irregardless of the "Dark Mode" toggle. This is because of a limitation of Tailwind Config Viewer.
@@ -0,0 +1,4 @@
1
+ import plugin, { darkThemeVariables, lightThemeVariables } from './plugin.js';
2
+ export default plugin;
3
+ export { darkThemeVariables, lightThemeVariables };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAE7E,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import plugin, { darkThemeVariables, lightThemeVariables } from './plugin.js';
2
+ export default plugin;
3
+ export { darkThemeVariables, lightThemeVariables };
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAE7E,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAA"}
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@speckle/tailwind-theme",
3
+ "description": "Speckle tailwind theme used in frontend 2 and other apps",
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "rimraf ./dist ./dist-cjs && tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package",
8
+ "viewer": "tailwind-config-viewer -o -c tailwind.test.config.cjs",
9
+ "lint:js": "eslint --ext \".js,.ts,.vue\" .",
10
+ "lint:tsc": "tsc --noEmit",
11
+ "lint:prettier": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --check .",
12
+ "lint": "yarn lint:js && yarn lint:tsc && yarn lint:prettier"
13
+ },
14
+ "engines": {
15
+ "node": "^18.0.0"
16
+ },
17
+ "peerDependencies": {
18
+ "postcss": "^8.4.18",
19
+ "postcss-nesting": "^10.2.0",
20
+ "tailwindcss": "^3.3.2"
21
+ },
22
+ "dependencies": {
23
+ "@tailwindcss/forms": "^0.5.3"
24
+ },
25
+ "devDependencies": {
26
+ "@types/eslint": "^8.4.5",
27
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
28
+ "@typescript-eslint/parser": "^5.38.1",
29
+ "eslint": "^8.24.0",
30
+ "eslint-config-prettier": "^8.5.0",
31
+ "prettier": "^2.7.1",
32
+ "rimraf": "^5.0.0",
33
+ "tailwind-config-viewer": "^1.7.2",
34
+ "tailwindcss": "^3.3.2",
35
+ "tsconfig-to-dual-package": "^1.2.0",
36
+ "typescript": "^5.0.4"
37
+ }
38
+ }
@@ -0,0 +1,72 @@
1
+ export declare const lightThemeVariables: {
2
+ '--foundation-page': string;
3
+ '--foundation': string;
4
+ '--foundation-2': string;
5
+ '--foundation-3': string;
6
+ '--foundation-4': string;
7
+ '--foundation-5': string;
8
+ '--foundation-focus': string;
9
+ '--foundation-disabled': string;
10
+ '--foreground': string;
11
+ '--foreground-2': string;
12
+ '--foreground-disabled': string;
13
+ '--foreground-primary': string;
14
+ '--foreground-on-primary': string;
15
+ '--primary': string;
16
+ '--primary-focus': string;
17
+ '--primary-muted': string;
18
+ '--outline-1': string;
19
+ '--outline-2': string;
20
+ '--outline-3': string;
21
+ '--success': string;
22
+ '--success-lighter': string;
23
+ '--success-darker': string;
24
+ '--warning': string;
25
+ '--warning-lighter': string;
26
+ '--warning-darker': string;
27
+ '--info': string;
28
+ '--info-lighter': string;
29
+ '--info-darker': string;
30
+ '--danger': string;
31
+ '--danger-lighter': string;
32
+ '--danger-darker': string;
33
+ };
34
+ export declare const darkThemeVariables: {
35
+ '--foundation-page': string;
36
+ '--foundation': string;
37
+ '--foundation-2': string;
38
+ '--foundation-3': string;
39
+ '--foundation-4': string;
40
+ '--foundation-5': string;
41
+ '--foundation-focus': string;
42
+ '--foundation-disabled': string;
43
+ '--foreground': string;
44
+ '--foreground-2': string;
45
+ '--foreground-disabled': string;
46
+ '--foreground-primary': string;
47
+ '--foreground-on-primary': string;
48
+ '--primary': string;
49
+ '--primary-focus': string;
50
+ '--primary-muted': string;
51
+ '--outline-1': string;
52
+ '--outline-2': string;
53
+ '--outline-3': string;
54
+ '--success': string;
55
+ '--success-lighter': string;
56
+ '--success-darker': string;
57
+ '--warning': string;
58
+ '--warning-lighter': string;
59
+ '--warning-darker': string;
60
+ '--info': string;
61
+ '--info-lighter': string;
62
+ '--info-darker': string;
63
+ '--danger': string;
64
+ '--danger-lighter': string;
65
+ '--danger-darker': string;
66
+ };
67
+ declare const _default: {
68
+ handler: import("tailwindcss/types/config.js").PluginCreator;
69
+ config?: Partial<import("tailwindcss").Config> | undefined;
70
+ };
71
+ export default _default;
72
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD/B,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD9B,CAAA;;;;;AAED,wBA0GU"}
package/dist/plugin.js ADDED
@@ -0,0 +1,209 @@
1
+ import plugin from 'tailwindcss/plugin.js';
2
+ import preset from './preset.js';
3
+ export const lightThemeVariables = {
4
+ /* used only as the page background */
5
+ '--foundation-page': '#f1f5f9',
6
+ /* used as the background for any elements that sit on the page */
7
+ '--foundation': '#fcfcfc',
8
+ '--foundation-2': '#fcfcfc',
9
+ '--foundation-3': '#fcfcfc',
10
+ '--foundation-4': '#fcfcfc',
11
+ '--foundation-5': '#fcfcfc',
12
+ /* for hover/focus states */
13
+ '--foundation-focus': '#dbeafe',
14
+ /* for disabled backgrounds */
15
+ '--foundation-disabled': '#e5e5e5',
16
+ /* default foreground color */
17
+ '--foreground': '#334155',
18
+ /* dimmer foreground color, e.g. caption text */
19
+ '--foreground-2': '#94a3b8',
20
+ /* disabled foreground color */
21
+ '--foreground-disabled': '#a3a3a3',
22
+ /* primary color when used for text directly on top of foundation-page */
23
+ '--foreground-primary': '#3b82f6',
24
+ /* foreground color when put on top of a primary colored background */
25
+ '--foreground-on-primary': '#fff',
26
+ /* primary color */
27
+ '--primary': '#3b82f6',
28
+ /* focused primary color */
29
+ '--primary-focus': '#2563eb',
30
+ /* muted primary color */
31
+ '--primary-muted': '#3b82f60d',
32
+ /* outline variations */
33
+ '--outline-1': '#3b82f6',
34
+ '--outline-2': '#93c5fd',
35
+ '--outline-3': '#cbd5e1',
36
+ /* success variations */
37
+ '--success': '#34d399',
38
+ '--success-lighter': '#d1fae5',
39
+ '--success-darker': '#064e3b',
40
+ /* warning variations */
41
+ '--warning': '#fbbf24',
42
+ '--warning-lighter': '#fef3c7',
43
+ '--warning-darker': '#78350f',
44
+ /* info variations */
45
+ '--info': '#38bdf8',
46
+ '--info-lighter': '#e0f2fe',
47
+ '--info-darker': '#0c4a6e',
48
+ /* danger variations */
49
+ '--danger': '#f87171',
50
+ '--danger-lighter': '#fee2e2',
51
+ '--danger-darker': '#7f1d1d'
52
+ };
53
+ export const darkThemeVariables = {
54
+ /* used only as the page background */
55
+ '--foundation-page': '#18181b',
56
+ /* used as the background for any elements that sit on the page */
57
+ '--foundation': '#27272a',
58
+ '--foundation-2': '#303034',
59
+ '--foundation-3': '#52525b',
60
+ '--foundation-4': '#71717a',
61
+ '--foundation-5': '#a1a1aa',
62
+ /* for hover/focus states */
63
+ '--foundation-focus': '#52525b',
64
+ /* for disabled backgrounds */
65
+ '--foundation-disabled': '#3c3c3d',
66
+ /* default foreground color */
67
+ '--foreground': '#f4f4f5',
68
+ /* dimmer foreground color, e.g. caption text */
69
+ '--foreground-2': '#71717a',
70
+ /* disabled foreground color */
71
+ '--foreground-disabled': '#5a5a5f',
72
+ /* primary color when used for text directly on top of foundation-page */
73
+ '--foreground-primary': '#bfdbfe',
74
+ /* foreground color when put on top of a primary colored background */
75
+ '--foreground-on-primary': '#fafafa',
76
+ /* primary color */
77
+ '--primary': '#3b82f6',
78
+ /* focused primary color */
79
+ '--primary-focus': '#60a5fa',
80
+ /* muted primary color */
81
+ '--primary-muted': '#71717a0d',
82
+ /* outline variations */
83
+ '--outline-1': '#a1a1aa',
84
+ '--outline-2': '#52525b',
85
+ '--outline-3': '#3f3f46',
86
+ /* success variations */
87
+ '--success': '#34d399',
88
+ '--success-lighter': '#a7f3d0',
89
+ '--success-darker': '#064e3b',
90
+ /* warning variations */
91
+ '--warning': '#facc15',
92
+ '--warning-lighter': '#fef08a',
93
+ '--warning-darker': '#78350f',
94
+ /* info variations */
95
+ '--info': '#38bdf8',
96
+ '--info-lighter': '#bae6fd',
97
+ '--info-darker': '#0c4a6e',
98
+ /* danger variations */
99
+ '--danger': '#f87171',
100
+ '--danger-lighter': '#fecaca',
101
+ '--danger-darker': '#7f1d1d'
102
+ };
103
+ export default plugin(function ({ addComponents, addBase }) {
104
+ addBase({
105
+ "[type='checkbox']:focus, [type='radio']:focus": {
106
+ '@apply ring-offset-foundation': {}
107
+ },
108
+ body: {
109
+ '@apply font-sans': {}
110
+ },
111
+ html: {
112
+ '--simple-scrollbar-width': '4px',
113
+ ...lightThemeVariables,
114
+ '&.dark': {
115
+ ...darkThemeVariables
116
+ }
117
+ },
118
+ // weird hack cause for some reason tailwind sometimes omits this if I use `.dark` selector instead (tailwind bug?)
119
+ [`html[class*="dark"]`]: {
120
+ ...darkThemeVariables
121
+ }
122
+ });
123
+ addComponents({
124
+ // Font sizes
125
+ '.h1': {
126
+ '@apply text-5xl leading-10': {}
127
+ },
128
+ '.h2': {
129
+ '@apply text-4xl leading-10': {}
130
+ },
131
+ '.h3': {
132
+ '@apply text-3xl leading-9': {}
133
+ },
134
+ '.h4': {
135
+ '@apply text-2xl leading-8': {}
136
+ },
137
+ '.h5': {
138
+ '@apply text-xl leading-7': {}
139
+ },
140
+ '.h6': {
141
+ '@apply text-lg leading-6': {}
142
+ },
143
+ '.label': {
144
+ '@apply text-sm font-medium leading-5': {}
145
+ },
146
+ '.label--light': {
147
+ '@apply font-normal': {}
148
+ },
149
+ '.label-light': {
150
+ '@apply label label--light': {}
151
+ },
152
+ '.normal': {
153
+ '@apply text-base font-normal': {}
154
+ },
155
+ '.caption': {
156
+ '@apply text-xs': {}
157
+ },
158
+ '.text-tiny': {
159
+ 'font-size': '0.6rem',
160
+ 'line-height': '1rem'
161
+ },
162
+ // Grid/layout container that limits max width to expected sizes that we use in our designs
163
+ '.layout-container': {
164
+ '@apply mx-auto': {},
165
+ /* base/mobile - fluid, no max width, just padding */
166
+ '@apply px-4': {},
167
+ /* sm+ - also fluid, increased padding */
168
+ "@media (min-width: theme('screens.sm'))": {
169
+ '@apply px-8': {}
170
+ },
171
+ /* lg+ (from this point on, no padding just limited max width) */
172
+ "@media (min-width: theme('screens.lg'))": {
173
+ '@apply px-6 max-w-full': {}
174
+ },
175
+ /* xl+ */
176
+ "@media (min-width: theme('screens.xl'))": {
177
+ '@apply max-w-[1216px]': {}
178
+ },
179
+ /* 2xl+ */
180
+ "@media (min-width: theme('screens.2xl'))": {
181
+ '@apply max-w-[1312px]': {}
182
+ }
183
+ },
184
+ // Simple scrollbar (OSX-like) to use instead of the ugly browser one
185
+ '.simple-scrollbar': {
186
+ 'scrollbar-width': 'var(--simple-scrollbar-width)',
187
+ 'scrollbar-color': 'var(--foreground-2)',
188
+ '&::-webkit-scrollbar': {
189
+ width: 'var(--simple-scrollbar-width)',
190
+ height: '6px'
191
+ },
192
+ '&::-webkit-scrollbar-track': {
193
+ 'border-radius': '15px',
194
+ background: 'var(--foundation-disabled)'
195
+ },
196
+ '&::-webkit-scrollbar-thumb': {
197
+ 'border-radius': '15px',
198
+ background: 'var(--foreground-2)'
199
+ },
200
+ '&::-webkit-scrollbar-thumb:hover': {
201
+ background: 'var(--foreground-2)'
202
+ },
203
+ '&::-webkit-scrollbar-thumb:active': {
204
+ background: 'rgba(90 90 90 10100%)'
205
+ }
206
+ }
207
+ });
208
+ }, preset);
209
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAC1C,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,sCAAsC;IACtC,mBAAmB,EAAE,SAAS;IAC9B,kEAAkE;IAClE,cAAc,EAAE,SAAS;IACzB,gBAAgB,EAAE,SAAS;IAC3B,gBAAgB,EAAE,SAAS;IAC3B,gBAAgB,EAAE,SAAS;IAC3B,gBAAgB,EAAE,SAAS;IAC3B,4BAA4B;IAC5B,oBAAoB,EAAE,SAAS;IAC/B,8BAA8B;IAC9B,uBAAuB,EAAE,SAAS;IAElC,8BAA8B;IAC9B,cAAc,EAAE,SAAS;IACzB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ACpC;SACF;KACF,CAAC,CAAA;AACJ,CAAC,EAAE,MAAM,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'tailwindcss';
2
+ declare const config: Config;
3
+ export default config;
4
+ //# sourceMappingURL=preset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,QAAA,MAAM,MAAM,EAAE,MA0Eb,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/preset.js ADDED
@@ -0,0 +1,78 @@
1
+ import FormsPlugin from '@tailwindcss/forms';
2
+ const config = {
3
+ darkMode: 'class',
4
+ content: [
5
+ `./components/**/*.{vue,js,ts}`,
6
+ `./layouts/**/*.vue`,
7
+ `./pages/**/*.vue`,
8
+ `./composables/**/*.{js,ts}`,
9
+ `./plugins/**/*.{js,ts}`,
10
+ './stories/**/*.{js,ts,vue,mdx}',
11
+ './app.vue',
12
+ './.storybook/**/*.{js,ts,vue}',
13
+ './lib/**/composables/*.{js,ts}'
14
+ // `./lib/**/*.{js,ts,vue}`, // TODO: Wait for fix https://github.com/nuxt/framework/issues/2886#issuecomment-1108312903
15
+ ],
16
+ theme: {
17
+ fontFamily: {
18
+ sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"
19
+ },
20
+ extend: {
21
+ colors: {
22
+ foundation: {
23
+ page: 'var(--foundation-page)',
24
+ DEFAULT: 'var(--foundation)',
25
+ 2: 'var(--foundation-2)',
26
+ 3: 'var(--foundation-3)',
27
+ 4: 'var(--foundation-4)',
28
+ 5: 'var(--foundation-5)',
29
+ focus: 'var(--foundation-focus)',
30
+ disabled: 'var(--foundation-disabled)'
31
+ },
32
+ foreground: {
33
+ DEFAULT: 'var(--foreground)',
34
+ 2: 'var(--foreground-2)',
35
+ disabled: 'var(--foreground-disabled)',
36
+ 'on-primary': 'var(--foreground-on-primary)',
37
+ primary: 'var(--foreground-primary)'
38
+ },
39
+ primary: {
40
+ DEFAULT: 'var(--primary)',
41
+ focus: 'var(--primary-focus)',
42
+ muted: 'var(--primary-muted)'
43
+ },
44
+ outline: {
45
+ 1: 'var(--outline-1)',
46
+ 2: 'var(--outline-2)',
47
+ 3: 'var(--outline-3)'
48
+ },
49
+ success: {
50
+ DEFAULT: 'var(--success)',
51
+ lighter: 'var(--success-lighter)',
52
+ darker: 'var(--success-darker)'
53
+ },
54
+ warning: {
55
+ DEFAULT: 'var(--warning)',
56
+ lighter: 'var(--warning-lighter)',
57
+ darker: 'var(--warning-darker)'
58
+ },
59
+ info: {
60
+ DEFAULT: 'var(--info)',
61
+ lighter: 'var(--info-lighter)',
62
+ darker: 'var(--info-darker)'
63
+ },
64
+ danger: {
65
+ DEFAULT: 'var(--danger)',
66
+ lighter: 'var(--danger-lighter)',
67
+ darker: 'var(--danger-darker)'
68
+ }
69
+ },
70
+ borderRadius: {
71
+ '4xl': '2rem'
72
+ }
73
+ }
74
+ },
75
+ plugins: [FormsPlugin]
76
+ };
77
+ export default config;
78
+ //# sourceMappingURL=preset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preset.js","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAE5C,MAAM,MAAM,GAAW;IACrB,QAAQ,EAAE,OAAO;IACjB,OAAO,EAAE;QACP,+BAA+B;QAC/B,oBAAoB;QACpB,kBAAkB;QAClB,4BAA4B;QAC5B,wBAAwB;QACxB,gCAAgC;QAChC,WAAW;QACX,+BAA+B;QAC/B,gCAAgC;QAChC,wHAAwH;KACzH;IACD,KAAK,EAAE;QACL,UAAU,EAAE;YACV,IAAI,EAAE,+IAA+I;SACtJ;QACD,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EA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from './plugin.js';
2
+ export default plugin;
3
+ export { darkThemeVariables, lightThemeVariables };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAE7E,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.lightThemeVariables = exports.darkThemeVariables = void 0;
27
+ const plugin_js_1 = __importStar(require("./plugin.js"));
28
+ Object.defineProperty(exports, "darkThemeVariables", { enumerable: true, get: function () { return plugin_js_1.darkThemeVariables; } });
29
+ Object.defineProperty(exports, "lightThemeVariables", { enumerable: true, get: function () { return plugin_js_1.lightThemeVariables; } });
30
+ exports.default = plugin_js_1.default;
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA6E;AAGpE,mGAHQ,8BAAkB,OAGR;AAAE,oGAHQ,+BAAmB,OAGR;AADhD,kBAAe,mBAAM,CAAA"}
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@speckle/tailwind-theme",
3
+ "description": "Speckle tailwind theme used in frontend 2 and other apps",
4
+ "version": "0.0.1",
5
+ "type": "commonjs",
6
+ "scripts": {
7
+ "build": "rimraf ./dist ./dist-cjs && tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package",
8
+ "viewer": "tailwind-config-viewer -o -c tailwind.test.config.cjs",
9
+ "lint:js": "eslint --ext \".js,.ts,.vue\" .",
10
+ "lint:tsc": "tsc --noEmit",
11
+ "lint:prettier": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --check .",
12
+ "lint": "yarn lint:js && yarn lint:tsc && yarn lint:prettier"
13
+ },
14
+ "engines": {
15
+ "node": "^18.0.0"
16
+ },
17
+ "peerDependencies": {
18
+ "postcss": "^8.4.18",
19
+ "postcss-nesting": "^10.2.0",
20
+ "tailwindcss": "^3.3.2"
21
+ },
22
+ "dependencies": {
23
+ "@tailwindcss/forms": "^0.5.3"
24
+ },
25
+ "devDependencies": {
26
+ "@types/eslint": "^8.4.5",
27
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
28
+ "@typescript-eslint/parser": "^5.38.1",
29
+ "eslint": "^8.24.0",
30
+ "eslint-config-prettier": "^8.5.0",
31
+ "prettier": "^2.7.1",
32
+ "rimraf": "^5.0.0",
33
+ "tailwind-config-viewer": "^1.7.2",
34
+ "tailwindcss": "^3.3.2",
35
+ "tsconfig-to-dual-package": "^1.2.0",
36
+ "typescript": "^5.0.4"
37
+ }
38
+ }