@solfacil/girassol 0.1.2 → 0.1.6

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 (62) hide show
  1. package/.vscode/extensions.json +4 -2
  2. package/.vscode/settings.json +15 -5
  3. package/README.md +1 -1
  4. package/cli/package.json +2 -12
  5. package/cli/src/commands/create:component.ts +91 -0
  6. package/cli/src/commands/generate:plugin.ts +1 -1
  7. package/cli/src/commands/generate:types.ts +1 -1
  8. package/cli/src/commands/girassol.ts +1 -1
  9. package/cli/src/extensions/cli-extension.ts +1 -1
  10. package/cli/src/templates/components/component.spec.ts.ejs +20 -0
  11. package/cli/src/templates/components/component.stories.mdx.ejs +74 -0
  12. package/cli/src/templates/components/component.vue.ejs +23 -0
  13. package/cli/src/templates/components/index.ts.ejs +10 -0
  14. package/cli/yarn.lock +31 -2860
  15. package/dist/girassol.es.js +1106 -136
  16. package/dist/girassol.umd.js +5 -5
  17. package/dist/style.css +1 -1
  18. package/dist/theme/solfacil/colors.d.ts +2 -2
  19. package/dist/theme/solfacil/index.d.ts +3 -0
  20. package/dist/theme/solfacil/utilities.d.ts +3 -0
  21. package/dist/types/components/dropdown/Dropdown.vue.d.ts +77 -0
  22. package/dist/types/components/dropdown/dropdown.spec.d.ts +1 -0
  23. package/dist/types/components/dropdown/index.d.ts +2 -0
  24. package/dist/types/components/forms/button/Button.vue.d.ts +4 -4
  25. package/dist/types/components/forms/checkbox/CheckboxGroup.vue.d.ts +1 -1
  26. package/dist/types/components/forms/checkbox/checkbox-type.d.ts +2 -2
  27. package/dist/types/components/forms/checkbox/index.d.ts +1 -1
  28. package/dist/types/components/forms/input/Input.vue.d.ts +3 -1
  29. package/dist/types/components/forms/input/index.d.ts +1 -1
  30. package/dist/types/components/forms/radio/RadioGroup.vue.d.ts +1 -1
  31. package/dist/types/components/forms/radio/index.d.ts +1 -1
  32. package/dist/types/components/forms/radio/radio-type.d.ts +2 -2
  33. package/dist/types/components/forms/select/Select.vue.d.ts +53 -0
  34. package/dist/types/components/forms/select/index.d.ts +2 -0
  35. package/dist/types/components/forms/select/select.spec.d.ts +1 -0
  36. package/dist/types/components/forms/switch/index.d.ts +1 -1
  37. package/dist/types/components/forms/textarea/Textarea.vue.d.ts +50 -0
  38. package/dist/types/components/forms/textarea/index.d.ts +2 -0
  39. package/dist/types/components/forms/textarea/textarea.spec.d.ts +1 -0
  40. package/dist/types/components/forms/textfield/Textfield.vue.d.ts +1 -1
  41. package/dist/types/components/forms/textfield/index.d.ts +1 -1
  42. package/dist/types/composables/use-toast/Toast.vue.d.ts +66 -0
  43. package/dist/types/composables/use-toast/index.d.ts +9 -0
  44. package/dist/types/composables/use-toast/types.d.ts +23 -0
  45. package/dist/types/composables/use-toast/use-toast.spec.d.ts +1 -0
  46. package/dist/types/composables/use-toast/useTimer.d.ts +9 -0
  47. package/dist/types/composables/use-toast/useTransition.d.ts +57 -0
  48. package/dist/types/index.d.ts +5 -1
  49. package/dist/vite.config.d.ts +1 -1
  50. package/dist/windi.config.d.ts +1 -1
  51. package/package.json +65 -33
  52. package/theme/solfacil/borders.ts +2 -2
  53. package/theme/solfacil/colors.ts +4 -4
  54. package/theme/solfacil/effects.ts +3 -3
  55. package/theme/solfacil/index.ts +5 -2
  56. package/theme/solfacil/miscs.ts +2 -2
  57. package/theme/solfacil/spacing.ts +1 -1
  58. package/theme/solfacil/typography.ts +2 -2
  59. package/theme/solfacil/utilities.ts +88 -3
  60. package/vite.config.ts +16 -4
  61. package/windi.config.ts +7 -4
  62. package/cli/__tests__/cli-integration.test.ts +0 -29
@@ -0,0 +1,50 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ id: string;
3
+ class?: string | undefined;
4
+ modelValue?: string | undefined;
5
+ label?: string | undefined;
6
+ hint?: string | undefined;
7
+ invert?: boolean | undefined;
8
+ resize?: "both" | "horizontal" | "vertical" | "none" | undefined;
9
+ error?: string | undefined;
10
+ }>, {
11
+ modelValue: string;
12
+ label: string;
13
+ resize: string;
14
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (event: string) => void;
16
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
17
+ id: string;
18
+ class?: string | undefined;
19
+ modelValue?: string | undefined;
20
+ label?: string | undefined;
21
+ hint?: string | undefined;
22
+ invert?: boolean | undefined;
23
+ resize?: "both" | "horizontal" | "vertical" | "none" | undefined;
24
+ error?: string | undefined;
25
+ }>, {
26
+ modelValue: string;
27
+ label: string;
28
+ resize: string;
29
+ }>>> & {
30
+ "onUpdate:modelValue"?: ((event: string) => any) | undefined;
31
+ }, {
32
+ modelValue: string;
33
+ label: string;
34
+ resize: "both" | "horizontal" | "vertical" | "none";
35
+ }>;
36
+ export default _default;
37
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
38
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
39
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
40
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
41
+ } : {
42
+ type: import('vue').PropType<T[K]>;
43
+ required: true;
44
+ };
45
+ };
46
+ declare type __VLS_WithDefaults<P, D> = {
47
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
48
+ default: D[K];
49
+ } : P[K];
50
+ };
@@ -0,0 +1,2 @@
1
+ import SolTextarea from './Textarea.vue';
2
+ export { SolTextarea, };
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -25,8 +25,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
25
25
  }>>> & {
26
26
  "onUpdate:modelValue"?: ((event: string) => any) | undefined;
27
27
  }, {
28
- label: string;
29
28
  modelValue: string;
29
+ label: string;
30
30
  }>;
31
31
  export default _default;
32
32
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,3 +1,3 @@
1
1
  import SolTextfield from './Textfield.vue';
2
2
  import SolTextfieldPassword from './TextfieldPassword.vue';
3
- export { SolTextfield, SolTextfieldPassword };
3
+ export { SolTextfield, SolTextfieldPassword, };
@@ -0,0 +1,66 @@
1
+ import type { Position, ToastType } from './types';
2
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
+ id: string | number;
4
+ type: ToastType;
5
+ visible?: boolean | undefined;
6
+ title: string;
7
+ description?: string | undefined;
8
+ timeout: number;
9
+ hideProgressBar?: boolean | undefined;
10
+ showIcon?: boolean | undefined;
11
+ offset: number;
12
+ onClose?: (() => void) | undefined;
13
+ onCloseHandler?: (() => void) | undefined;
14
+ position?: Position | undefined;
15
+ }>, {
16
+ type: ToastType | undefined;
17
+ delay: number | undefined;
18
+ showIcon: boolean | undefined;
19
+ position: Position | undefined;
20
+ hideProgressBar: boolean | undefined;
21
+ offset: number;
22
+ visible: boolean;
23
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
24
+ id: string | number;
25
+ type: ToastType;
26
+ visible?: boolean | undefined;
27
+ title: string;
28
+ description?: string | undefined;
29
+ timeout: number;
30
+ hideProgressBar?: boolean | undefined;
31
+ showIcon?: boolean | undefined;
32
+ offset: number;
33
+ onClose?: (() => void) | undefined;
34
+ onCloseHandler?: (() => void) | undefined;
35
+ position?: Position | undefined;
36
+ }>, {
37
+ type: ToastType | undefined;
38
+ delay: number | undefined;
39
+ showIcon: boolean | undefined;
40
+ position: Position | undefined;
41
+ hideProgressBar: boolean | undefined;
42
+ offset: number;
43
+ visible: boolean;
44
+ }>>>, {
45
+ type: ToastType;
46
+ offset: number;
47
+ position: Position;
48
+ visible: boolean;
49
+ hideProgressBar: boolean;
50
+ showIcon: boolean;
51
+ }>;
52
+ export default _default;
53
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
54
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
55
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
56
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
57
+ } : {
58
+ type: import('vue').PropType<T[K]>;
59
+ required: true;
60
+ };
61
+ };
62
+ declare type __VLS_WithDefaults<P, D> = {
63
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
64
+ default: D[K];
65
+ } : P[K];
66
+ };
@@ -0,0 +1,9 @@
1
+ import type { Position, ToastContent, ToastOptions } from './types';
2
+ export declare function useToast(): {
3
+ createToast: (content: string | ToastContent, options?: ToastOptions | undefined) => {
4
+ close: () => void;
5
+ };
6
+ clearAllToasts: () => void;
7
+ };
8
+ declare function close(id: number, position: Position): void;
9
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { VNode } from 'vue';
2
+ export declare type ToastType = 'info' | 'danger' | 'warning' | 'success';
3
+ export declare type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
4
+ export interface ToastContent {
5
+ title: string;
6
+ description?: string;
7
+ }
8
+ export interface ToastOptions {
9
+ type?: ToastType;
10
+ timeout?: number;
11
+ position?: Position;
12
+ showIcon?: boolean;
13
+ showCloseButton?: boolean;
14
+ hideProgressBar?: boolean;
15
+ onClose?: () => void;
16
+ showOneToast?: boolean;
17
+ }
18
+ export interface ToastObject {
19
+ toastVNode: VNode;
20
+ container: HTMLDivElement;
21
+ }
22
+ export declare const TOAST_GAP = 12;
23
+ export declare const DEFAULT_OPTIONS: ToastOptions;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,9 @@
1
+ import type { Ref } from 'vue';
2
+ interface TimerReturn {
3
+ start: () => void;
4
+ stop: () => void;
5
+ clear: () => void;
6
+ progress: Ref<number>;
7
+ }
8
+ export declare function useTimer(callback: () => void | string, delay: number): TimerReturn;
9
+ export {};
@@ -0,0 +1,57 @@
1
+ import type { Position } from "./types";
2
+ export declare function usePosition(fn: () => ({
3
+ position: Position;
4
+ offset: number;
5
+ })): {
6
+ stylePosition: import("vue").ComputedRef<{
7
+ left: string;
8
+ top: string;
9
+ bottom?: undefined;
10
+ right?: undefined;
11
+ marginRight?: undefined;
12
+ marginLeft?: undefined;
13
+ } | {
14
+ left: string;
15
+ bottom: string;
16
+ top?: undefined;
17
+ right?: undefined;
18
+ marginRight?: undefined;
19
+ marginLeft?: undefined;
20
+ } | {
21
+ right: string;
22
+ bottom: string;
23
+ left?: undefined;
24
+ top?: undefined;
25
+ marginRight?: undefined;
26
+ marginLeft?: undefined;
27
+ } | {
28
+ top: string;
29
+ left: string;
30
+ right: string;
31
+ marginRight: string;
32
+ marginLeft: string;
33
+ bottom?: undefined;
34
+ } | {
35
+ bottom: string;
36
+ left: string;
37
+ right: string;
38
+ marginRight: string;
39
+ marginLeft: string;
40
+ top?: undefined;
41
+ } | {
42
+ right: string;
43
+ top: string;
44
+ left?: undefined;
45
+ bottom?: undefined;
46
+ marginRight?: undefined;
47
+ marginLeft?: undefined;
48
+ }>;
49
+ };
50
+ export declare enum Transition {
51
+ 'top-left' = "bounce-left",
52
+ 'top-right' = "bounce-right",
53
+ 'top-center' = "bounce-down",
54
+ 'bottom-left' = "bounce-left",
55
+ 'bottom-center' = "bounce-up",
56
+ 'bottom-right' = "bounce-right"
57
+ }
@@ -2,13 +2,17 @@ import type { App } from 'vue';
2
2
  import { SolButton } from './components/forms/button';
3
3
  import { SolInput } from './components/forms/input';
4
4
  import { SolTextfield, SolTextfieldPassword } from './components/forms/textfield';
5
+ import { SolTextarea } from './components/forms/textarea';
5
6
  import { SolRadio, SolRadioGroup } from './components/forms/radio';
6
7
  import { SolCheckbox, SolCheckboxGroup } from './components/forms/checkbox';
7
8
  import { SolSwitch } from './components/forms/switch';
9
+ import { SolDropdown } from './components/dropdown/';
10
+ import { SolSelect } from './components/forms/select';
8
11
  import 'virtual:windi-base.css';
9
12
  import 'virtual:windi-components.css';
10
13
  import 'virtual:windi-utilities.css';
11
14
  import '@/assets/style.css';
15
+ export { useToast } from './composables/use-toast';
12
16
  export declare function install(App: App): void;
13
- export { SolButton, SolInput, SolTextfield, SolTextfieldPassword, SolRadio, SolRadioGroup, SolCheckbox, SolCheckboxGroup, SolSwitch };
17
+ export { SolButton, SolInput, SolTextarea, SolTextfield, SolTextfieldPassword, SolRadio, SolRadioGroup, SolCheckbox, SolCheckboxGroup, SolSwitch, SolDropdown, SolSelect, };
14
18
  export declare const componentsNames: string[];
@@ -1,2 +1,2 @@
1
- declare const _default: import("vite").UserConfigExport;
1
+ declare const _default: import("vitest/dist/config").UserConfig;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vite-plugin-windicss").WindiCssOptions;
1
+ declare const _default: import("windicss/types/interfaces").FullConfig;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@solfacil/girassol",
3
- "version": "0.1.2",
3
+ "description": "Girassol design system",
4
+ "version": "0.1.6",
4
5
  "authors": [
5
6
  {
6
7
  "name": "Kevin Martin",
7
- "email": "kevinbreaker2604@gmail.com"
8
+ "email": "kevinbreaker2604@gmail.com",
9
+ "url": "https://github.com/kevinbreaker"
8
10
  }
9
11
  ],
10
12
  "engines": {
@@ -25,7 +27,8 @@
25
27
  "import": "./dist/girassol.es.js",
26
28
  "require": "./dist/girassol.umd.js"
27
29
  },
28
- "./dist/style.css": "./dist/style.css"
30
+ "./dist/style.css": "./dist/style.css",
31
+ "./windi.config.ts": "./windi.config.ts"
29
32
  },
30
33
  "types": "./dist/types/index.d.ts",
31
34
  "scripts": {
@@ -33,51 +36,80 @@
33
36
  "build:lib": "vue-tsc --noEmit && vite build",
34
37
  "build:lib:ts": "vite build && vue-tsc --emitDeclarationOnly && mv dist/src dist/types",
35
38
  "preview": "vite preview",
39
+ "lint": "eslint src/ --resolve-plugins-relative-to .",
40
+ "lint:fix": "eslint src/ --fix --resolve-plugins-relative-to .",
36
41
  "girassol": "girassol",
37
- "test": "jest --silent",
38
- "test:w": "jest --silent --watch",
42
+ "test": "vitest run",
43
+ "test:w": "vitest watch --silent ",
44
+ "test:coverage": "vitest run --silent --coverage",
39
45
  "storybook": "start-storybook -p 6006 --ci",
40
46
  "build-storybook": "build-storybook"
41
47
  },
42
48
  "dependencies": {
43
- "@vueuse/core": "^8.2.0",
44
- "vue": "^3.2.31"
49
+ "@vueuse/core": "^8.5.0",
50
+ "vue": "^3.2.33"
45
51
  },
46
52
  "devDependencies": {
47
- "@antfu/eslint-config": "^0.18.9",
48
- "@babel/core": "^7.17.8",
53
+ "@antfu/eslint-config": "^0.23.1",
54
+ "@babel/core": "^7.17.9",
49
55
  "@babel/preset-env": "^7.16.11",
50
- "@iconify/json": "^2.1.21",
51
- "@storybook/addon-a11y": "^6.4.19",
52
- "@storybook/addon-actions": "^6.4.19",
53
- "@storybook/addon-essentials": "^6.4.19",
54
- "@storybook/addon-links": "^6.4.19",
55
- "@storybook/theming": "^6.4.19",
56
- "@storybook/vue3": "^6.4.19",
57
- "@testing-library/jest-dom": "^5.16.3",
58
- "@testing-library/user-event": "^13.5.0",
56
+ "@iconify/json": "^2.1.28",
57
+ "@storybook/addon-a11y": "^6.4.22",
58
+ "@storybook/addon-actions": "^6.4.22",
59
+ "@storybook/addon-essentials": "^6.4.22",
60
+ "@storybook/addon-links": "^6.4.22",
61
+ "@storybook/theming": "^6.4.22",
62
+ "@storybook/vue3": "^6.4.22",
63
+ "@testing-library/jest-dom": "^5.16.4",
64
+ "@testing-library/user-event": "^14.2.0",
59
65
  "@testing-library/vue": "^6.5.1",
60
- "@types/jest": "^27.4.1",
61
66
  "@types/jest-axe": "^3.5.3",
62
- "@types/node": "^17.0.23",
63
- "@vitejs/plugin-vue": "^2.2.4",
64
- "@vue/vue3-jest": "^27.0.0-alpha.4",
65
- "babel-jest": "^27.5.1",
67
+ "@types/node": "^17.0.24",
68
+ "@typescript-eslint/eslint-plugin": "^5.25.0",
69
+ "@typescript-eslint/parser": "^5.25.0",
70
+ "@vitejs/plugin-vue": "^2.3.1",
66
71
  "babel-loader": "^8.2.4",
72
+ "c8": "^7.11.0",
67
73
  "critters": "^0.0.16",
68
- "jest": "^27.5.1",
74
+ "eslint": "^8.14.0",
75
+ "eslint-config-prettier": "^8.5.0",
76
+ "eslint-plugin-html": "^6.2.0",
77
+ "eslint-plugin-prettier": "^4.0.0",
78
+ "eslint-plugin-vue": "^8.7.1",
79
+ "eslint-plugin-vuejs-accessibility": "^1.1.1",
69
80
  "jest-axe": "^5.0.1",
70
- "sass": "^1.49.9",
81
+ "jsdom": "^19.0.0",
82
+ "sass": "^1.50.0",
71
83
  "storybook-addon-designs": "^6.2.1",
72
- "storybook-builder-vite": "^0.1.22",
73
- "ts-jest": "^27.1.4",
84
+ "storybook-builder-vite": "^0.1.23",
85
+ "stylelint": "^14.8.2",
86
+ "stylelint-config-prettier": "^9.0.3",
87
+ "stylelint-config-property-sort-order-smacss": "^9.0.0",
88
+ "stylelint-order": "^5.0.0",
74
89
  "typescript": "^4.6.3",
75
90
  "unplugin-icons": "^0.14.1",
76
- "vite": "^2.8.6",
91
+ "vite": "^2.9.9",
77
92
  "vite-plugin-inspect": "^0.4.3",
78
- "vite-plugin-windicss": "^1.8.3",
79
- "vue-loader": "^16.8.3",
80
- "vue-tsc": "^0.33.9",
81
- "windicss": "^3.5.1"
82
- }
93
+ "vite-plugin-windicss": "^1.8.4",
94
+ "vitest": "^0.12.6",
95
+ "vue-loader": "^17.0.0",
96
+ "vue-tsc": "^0.34.15",
97
+ "windicss": "^3.5.4"
98
+ },
99
+ "repository": {
100
+ "type": "git",
101
+ "url": "https://github.com/solfacil/girassol"
102
+ },
103
+ "keywords": [
104
+ "vue 3",
105
+ "Components",
106
+ "solfacil",
107
+ "girassol",
108
+ "windicss",
109
+ "design system",
110
+ "vue",
111
+ "vue.js",
112
+ "nuxt",
113
+ "nuxt 3"
114
+ ]
83
115
  }
@@ -6,7 +6,7 @@ export default {
6
6
  lg: '1rem',
7
7
  full: '40rem',
8
8
  half: '50%',
9
- fully: '100%'
9
+ fully: '100%',
10
10
  },
11
11
 
12
12
 
@@ -16,5 +16,5 @@ export default {
16
16
  sm: '2px',
17
17
  md: '4px',
18
18
  lg: '8px',
19
- }
19
+ },
20
20
  }
@@ -7,7 +7,7 @@ export default {
7
7
  },
8
8
  },
9
9
 
10
- neutrals: {
10
+ neutral: {
11
11
  low: {
12
12
  light: '#8f8f8f',
13
13
  medium: '#525252',
@@ -23,8 +23,8 @@ export default {
23
23
 
24
24
  feedback: {
25
25
  positive: {
26
- medium: '#eefbf6',
27
- light: '#8ae5bf',
26
+ light: '#eefbf6',
27
+ medium: '#8ae5bf',
28
28
  pure: '#47d79a',
29
29
  },
30
30
 
@@ -39,5 +39,5 @@ export default {
39
39
  medium: '#ff7470',
40
40
  pure: '#ff251f',
41
41
  },
42
- }
42
+ },
43
43
  }
@@ -4,12 +4,12 @@ export default {
4
4
 
5
5
  strong: 0.8,
6
6
  moderate: 0.32,
7
- weak: 0.16
7
+ weak: 0.16,
8
8
  },
9
9
 
10
10
  boxShadow: {
11
11
  soft: '0px 8px 16px rgba(41, 41, 41, 0.08)',
12
12
  medium: '0px 12px 24px rgba(41, 41, 41, 0.16)',
13
- large: '0px 16px 64px rgba(41, 41, 41, 0.24)'
14
- }
13
+ large: '0px 16px 64px rgba(41, 41, 41, 0.24)',
14
+ },
15
15
  }
@@ -5,7 +5,7 @@ import spacing from './spacing'
5
5
  import effects from './effects'
6
6
  import misc from './miscs'
7
7
 
8
- import { outlinesForFocus } from './utilities'
8
+ import { debug, maxLines, outlinesForFocus, placeholder } from './utilities'
9
9
 
10
10
 
11
11
  export {
@@ -18,5 +18,8 @@ export {
18
18
  }
19
19
 
20
20
  export const utilities = {
21
- outlinesForFocus
21
+ outlinesForFocus,
22
+ maxLines,
23
+ debug,
24
+ placeholder,
22
25
  }
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  width: {
3
- 'fit-content': 'fit-content'
3
+ 'fit-content': 'fit-content',
4
4
  },
5
5
 
6
6
  colors: {
@@ -10,5 +10,5 @@ export default {
10
10
  outline: {
11
11
  focused: '',
12
12
  'focused-invert': '',
13
- }
13
+ },
14
14
  }
@@ -51,6 +51,6 @@ export default {
51
51
  '3xl': '6rem',
52
52
  'mega': '7.5rem',
53
53
  'giga': '12.5rem',
54
- }
54
+ },
55
55
  }
56
56
 
@@ -40,12 +40,12 @@ export default {
40
40
  fontWeight: {
41
41
  regular: 400,
42
42
  medium: 500,
43
- bold: 700
43
+ bold: 700,
44
44
  },
45
45
 
46
46
  letterSpacing: {
47
47
  default: 'normal',
48
48
  md: '0.04rem',
49
49
  sm: '0.16rem',
50
- }
50
+ },
51
51
  }
@@ -4,12 +4,97 @@ export const outlinesForFocus = plugin(({ addUtilities }) => {
4
4
  addUtilities({
5
5
  '.outline-focused': {
6
6
  outline: '3px solid #292929',
7
- outlineOffset: '0px'
7
+ outlineOffset: '0px',
8
8
  },
9
9
 
10
10
  '.outline-focused-invert': {
11
11
  outline: '3px solid #ffffff',
12
- outlineOffset: '0px'
13
- }
12
+ outlineOffset: '0px',
13
+ },
14
+ })
15
+ })
16
+
17
+ export const maxLines = plugin(({ addUtilities }) => {
18
+ const total = 10
19
+ const variants = {}
20
+
21
+ for (let i = 1; i <= total; i++) {
22
+ Object.assign(variants, {
23
+ [`.max-lines-${i}`]: {
24
+ overflow: 'hidden',
25
+ 'line-clamp': `${i}`,
26
+ '-webkit-line-clamp': `${i}`,
27
+ 'display': '-webkit-box',
28
+ '-webkit-box-orient': 'vertical',
29
+ },
30
+ })
31
+ }
32
+
33
+ addUtilities(variants)
34
+ })
35
+
36
+ export const debug = plugin(({ addUtilities }) => {
37
+ addUtilities({
38
+ '.debug': {
39
+ outline: '2px dashed #ff0000!important',
40
+ },
41
+
42
+ '.debug-all': {
43
+ outline: '2px dashed #ff0000!important',
44
+ outlineOffset: '3px',
45
+ '> *': {
46
+ outline: '2px dotted #a0092f!important',
47
+ outlineOffset: '3px',
48
+ '> *': {
49
+ outline: '2px dashed #00ffff!important',
50
+ outlineOffset: '3px',
51
+ '> *': {
52
+ outline: '2px dotted #ff00ff!important',
53
+ outlineOffset: '3px',
54
+ '> *': {
55
+ outline: '2px dashed #f0ad2aff!important',
56
+ outlineOffset: '3px',
57
+ '> *': {
58
+ outline: '2px dotted #00ff00!important',
59
+ outlineOffset: '3px',
60
+ '> *': {
61
+ outline: '2px dashed #d9ffaa!important',
62
+ outlineOffset: '3px',
63
+ '> *': {
64
+ outline: '2px dotted #2adeff!important',
65
+ outlineOffset: '3px',
66
+ '> *': {
67
+ outline: '2px dashed #00af2f!important',
68
+ outlineOffset: '3px',
69
+ '*': {
70
+ outline: '2px groove #0faefa!important',
71
+ outlineOffset: '3px',
72
+ },
73
+ },
74
+ },
75
+ },
76
+ },
77
+ },
78
+ },
79
+ },
80
+ },
81
+ },
14
82
  })
15
83
  })
84
+
85
+ export const placeholder = plugin(({ addUtilities, theme }) => {
86
+ const placeholderSettings = {
87
+ color: `${theme('colors.neutral.low.light')} !important`,
88
+ fontSize: `${theme('fonts.3xs')} !important`,
89
+ fontFamily: `${theme('fonts.base')} !important`,
90
+ lineHeight: `${theme('fonts.leading-xs')} !important`,
91
+ }
92
+
93
+ addUtilities({
94
+ '.placeholder': {
95
+ '&::placeholder': placeholderSettings,
96
+ },
97
+
98
+ '.placeholder-inline': placeholderSettings,
99
+ })
100
+ })