@solfacil/girassol 0.2.0 → 0.2.1

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.
@@ -21,30 +21,33 @@ export declare const components: {
21
21
  $: import("vue").ComponentInternalInstance;
22
22
  $data: {};
23
23
  $props: Partial<{
24
- invert: boolean;
25
- variant: "flat" | "primary" | "secondary";
26
- dense: boolean;
24
+ onColor: boolean;
25
+ size: "small" | "large" | "medium";
26
+ variant: "primary" | "secondary" | "tertiary";
27
27
  }> & Omit<Readonly<import("vue").ExtractPropTypes<{
28
28
  id: {
29
29
  type: import("vue").PropType<string>;
30
30
  required: true;
31
31
  };
32
- invert: {
32
+ loading: {
33
+ type: import("vue").PropType<boolean>;
34
+ };
35
+ onColor: {
33
36
  type: import("vue").PropType<boolean>;
34
37
  } & {
35
38
  default: boolean;
36
39
  };
37
- variant: {
38
- type: import("vue").PropType<"flat" | "primary" | "secondary">;
40
+ size: {
41
+ type: import("vue").PropType<"small" | "large" | "medium">;
39
42
  } & {
40
43
  default: string;
41
44
  };
42
- dense: {
43
- type: import("vue").PropType<boolean>;
45
+ variant: {
46
+ type: import("vue").PropType<"primary" | "secondary" | "tertiary">;
44
47
  } & {
45
- default: boolean;
48
+ default: string;
46
49
  };
47
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "invert" | "variant" | "dense">;
50
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "onColor" | "size" | "variant">;
48
51
  $attrs: {
49
52
  [x: string]: unknown;
50
53
  };
@@ -63,25 +66,28 @@ export declare const components: {
63
66
  type: import("vue").PropType<string>;
64
67
  required: true;
65
68
  };
66
- invert: {
69
+ loading: {
70
+ type: import("vue").PropType<boolean>;
71
+ };
72
+ onColor: {
67
73
  type: import("vue").PropType<boolean>;
68
74
  } & {
69
75
  default: boolean;
70
76
  };
71
- variant: {
72
- type: import("vue").PropType<"flat" | "primary" | "secondary">;
77
+ size: {
78
+ type: import("vue").PropType<"small" | "large" | "medium">;
73
79
  } & {
74
80
  default: string;
75
81
  };
76
- dense: {
77
- type: import("vue").PropType<boolean>;
82
+ variant: {
83
+ type: import("vue").PropType<"primary" | "secondary" | "tertiary">;
78
84
  } & {
79
- default: boolean;
85
+ default: string;
80
86
  };
81
87
  }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
82
- invert: boolean;
83
- variant: "flat" | "primary" | "secondary";
84
- dense: boolean;
88
+ onColor: boolean;
89
+ size: "small" | "large" | "medium";
90
+ variant: "primary" | "secondary" | "tertiary";
85
91
  }> & {
86
92
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
87
93
  created?: ((() => void) | (() => void)[]) | undefined;
@@ -107,20 +113,23 @@ export declare const components: {
107
113
  type: import("vue").PropType<string>;
108
114
  required: true;
109
115
  };
110
- invert: {
116
+ loading: {
117
+ type: import("vue").PropType<boolean>;
118
+ };
119
+ onColor: {
111
120
  type: import("vue").PropType<boolean>;
112
121
  } & {
113
122
  default: boolean;
114
123
  };
115
- variant: {
116
- type: import("vue").PropType<"flat" | "primary" | "secondary">;
124
+ size: {
125
+ type: import("vue").PropType<"small" | "large" | "medium">;
117
126
  } & {
118
127
  default: string;
119
128
  };
120
- dense: {
121
- type: import("vue").PropType<boolean>;
129
+ variant: {
130
+ type: import("vue").PropType<"primary" | "secondary" | "tertiary">;
122
131
  } & {
123
- default: boolean;
132
+ default: string;
124
133
  };
125
134
  }>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
126
135
  __isFragment?: undefined;
@@ -131,25 +140,28 @@ export declare const components: {
131
140
  type: import("vue").PropType<string>;
132
141
  required: true;
133
142
  };
134
- invert: {
143
+ loading: {
144
+ type: import("vue").PropType<boolean>;
145
+ };
146
+ onColor: {
135
147
  type: import("vue").PropType<boolean>;
136
148
  } & {
137
149
  default: boolean;
138
150
  };
139
- variant: {
140
- type: import("vue").PropType<"flat" | "primary" | "secondary">;
151
+ size: {
152
+ type: import("vue").PropType<"small" | "large" | "medium">;
141
153
  } & {
142
154
  default: string;
143
155
  };
144
- dense: {
145
- type: import("vue").PropType<boolean>;
156
+ variant: {
157
+ type: import("vue").PropType<"primary" | "secondary" | "tertiary">;
146
158
  } & {
147
- default: boolean;
159
+ default: string;
148
160
  };
149
161
  }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
150
- invert: boolean;
151
- variant: "flat" | "primary" | "secondary";
152
- dense: boolean;
162
+ onColor: boolean;
163
+ size: "small" | "large" | "medium";
164
+ variant: "primary" | "secondary" | "tertiary";
153
165
  }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
154
166
  $slots: {
155
167
  'icon-left': (_: {}) => any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solfacil/girassol",
3
3
  "description": "Girassol design system",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "authors": [
6
6
  {
7
7
  "name": "Kevin Martin",
@@ -57,7 +57,7 @@
57
57
  "pre-commit": "./.husky/run-staged-tests.js"
58
58
  },
59
59
  "dependencies": {
60
- "@vueuse/core": "^8.7.5",
60
+ "@vueuse/core": "^9.0.0",
61
61
  "gluegun": "latest",
62
62
  "vue": "^3.2.37"
63
63
  },
@@ -67,12 +67,12 @@
67
67
  "@babel/preset-env": "^7.18.6",
68
68
  "@commitlint/cli": "^17.0.3",
69
69
  "@commitlint/config-conventional": "^17.0.3",
70
- "@iconify/json": "^2.1.70",
70
+ "@iconify/json": "^2.1.84",
71
71
  "@storybook/addon-a11y": "^6.5.9",
72
72
  "@storybook/addon-actions": "^6.5.9",
73
73
  "@storybook/addon-essentials": "^6.5.9",
74
74
  "@storybook/addon-links": "^6.5.9",
75
- "@storybook/builder-vite": "^0.1.38",
75
+ "@storybook/builder-vite": "^0.2.2",
76
76
  "@storybook/theming": "^6.5.9",
77
77
  "@storybook/vue3": "^6.5.9",
78
78
  "@testing-library/jest-dom": "^5.16.4",
@@ -82,7 +82,7 @@
82
82
  "@types/node": "^17.0.41",
83
83
  "@typescript-eslint/eslint-plugin": "^5.30.0",
84
84
  "@typescript-eslint/parser": "^5.30.0",
85
- "@vitejs/plugin-vue": "^2.3.3",
85
+ "@vitejs/plugin-vue": "^3.0.1",
86
86
  "babel-loader": "^8.2.5",
87
87
  "c8": "^7.11.3",
88
88
  "cli-spinner": "^0.2.10",
@@ -107,12 +107,12 @@
107
107
  "ts-node": "^10.8.1",
108
108
  "typescript": "^4.7.4",
109
109
  "unplugin-icons": "^0.14.7",
110
- "vite": "^2.9.13",
110
+ "vite": "^3.0.3",
111
111
  "vite-plugin-inspect": "^0.5.1",
112
- "vite-plugin-windicss": "^1.8.6",
113
- "vitest": "^0.16.0",
112
+ "vite-plugin-windicss": "^1.8.7",
113
+ "vitest": "^0.19.1",
114
114
  "vue-loader": "^17.0.0",
115
- "vue-tsc": "^0.38.2",
115
+ "vue-tsc": "^0.39.2",
116
116
  "windicss": "^3.5.6"
117
117
  },
118
118
  "repository": {
@@ -0,0 +1,104 @@
1
+ type Data = {
2
+ colors: Record<string, any>
3
+ spacing: Record<string, any>
4
+ }
5
+
6
+ type Args = {
7
+ activeSafeList: boolean
8
+ data: Data
9
+ }
10
+
11
+ export function safelist({ activeSafeList = true, data }: Args): string[] {
12
+ if (activeSafeList) {
13
+ const colors = data.colors ? safelistElementColors(safelistColors(data.colors)) : []
14
+ const spacing = data.spacing ? safelistSpacing(data.spacing) : []
15
+
16
+ const gaps = range(20).map(i => `gap-${i}`)
17
+ const gridRows = range(14).map(i => `grid-rows-${i}`)
18
+ const gridCols = range(14).map(i => `grid-cols-${i}`)
19
+ const rowsStart = range(14).map(i => `row-start-${i}`)
20
+ const colsStart = range(14).map(i => `col-start-${i}`)
21
+ const rowsSpan = range(14).map(i => `row-span-${i}`)
22
+ const colsSpan = range(14).map(i => `col-span-${i}`)
23
+
24
+ return [
25
+ ...colors,
26
+ ...spacing,
27
+ ...gaps,
28
+ ...gridRows,
29
+ ...gridCols,
30
+ ...rowsStart,
31
+ ...colsStart,
32
+ ...rowsSpan,
33
+ ...colsSpan,
34
+ ]
35
+ }
36
+
37
+
38
+ return []
39
+ }
40
+
41
+ export function safelistColors(colors: Data['colors']) {
42
+ const colorsNames: string[] = []
43
+
44
+ for (const category in colors) {
45
+ for (const color in colors[category]) {
46
+ const current = colors[category][color]
47
+
48
+ if (typeof current === 'string') {
49
+ colorsNames.push(`${category}-${color}`)
50
+ }
51
+
52
+ if (typeof current === 'object') {
53
+ for (const insideColor in colors[category][color]) {
54
+ colorsNames.push(`${category}-${color}-${insideColor}`)
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ return colorsNames
61
+ }
62
+
63
+ export function safelistElementColors(colorsNames: string[]) {
64
+ const elements = ['text', 'bg', 'outline', 'fill', 'stroke', 'border', 'text-decoration-color', 'text-stroke-color']
65
+ const elementColors: string[] = []
66
+
67
+ elements.forEach((element: string) => {
68
+ colorsNames.forEach((color: string) => {
69
+ elementColors.push(`${element}-${color}`)
70
+ })
71
+ })
72
+
73
+ return elementColors
74
+ }
75
+
76
+
77
+ export function safelistSpacing(spacing: Data['spacing']): string[] {
78
+ const spacingTokenNames = Object.keys(spacing)
79
+ const paddings = ['p', 'px', 'py', 'pl', 'pr', 'pt', 'pb']
80
+ const margins = ['m', 'mx', 'my', 'ml', 'mr', 'mt', 'mb']
81
+
82
+ const typos = ['text', 'tracking', 'decoration', 'underline-offset', 'indent', 'text-stroke']
83
+ const svg = ['stroke']
84
+ const border = ['border-a', 'border-x', 'border-y', 'border-l', 'border-r', 'border-t', 'border-b']
85
+
86
+ const elements = [...paddings, ...margins, ...typos, ...svg, ...border]
87
+
88
+ const elementSpacing: string[] = []
89
+
90
+ elements.forEach((element: string) => {
91
+ spacingTokenNames.forEach((space: string) => {
92
+ elementSpacing.push(`${element}-${space}`)
93
+ })
94
+ })
95
+
96
+ margins.forEach(margin => elementSpacing.push(`${margin}-auto`))
97
+ paddings.forEach(padding => elementSpacing.push(`${padding}-auto`))
98
+
99
+ return elementSpacing
100
+ }
101
+
102
+ export function range(size: number, startAt = 1) {
103
+ return Array.from(Array(size).keys()).map(i => i + startAt)
104
+ }
@@ -1,32 +1,41 @@
1
1
  export default {
2
2
  brand: {
3
3
  primary: {
4
+ pure: '#000000',
5
+ light: '#a3a3a3',
6
+ medium: '#666666',
7
+ dark: '#212121',
8
+ },
9
+ secondary: {
4
10
  medium: '#BFFF00',
5
11
  light: '#EFFFC1',
6
12
  pure: '#00B569',
7
13
  dark: '#008859',
8
14
  },
9
15
  },
16
+
10
17
  highlight: {
11
18
  pure: '#8250DF',
12
19
  light: '#E6DCF9',
13
20
  medium: '#C0A7EF',
14
21
  dark: '#342059',
15
22
  },
23
+
16
24
  neutral: {
17
25
  low: {
18
26
  pure: '#000000',
19
- light: '#888888',
20
- medium: '#555555',
27
+ light: '#757575',
28
+ medium: '#505050',
21
29
  dark: '#222222',
22
30
  },
23
31
  high: {
24
32
  pure: '#ffffff',
25
- light: '#F5f5f5',
26
- medium: '#e0e0e0',
27
- dark: '#cccccc',
33
+ light: '#F0f0f0',
34
+ medium: '#dedede',
35
+ dark: '#c8c8c8',
28
36
  },
29
37
  },
38
+
30
39
  feedback: {
31
40
  positive: {
32
41
  pure: '#1CA36F',
@@ -2,16 +2,16 @@ export default {
2
2
  opacity: {
3
3
  'DEFAULT': 1,
4
4
 
5
- strong: 0.8,
5
+ semiopaque: 0.8,
6
6
  intense: 0.6,
7
- moderate: 0.32,
8
- weak: 0.16,
7
+ medium: 0.32,
8
+ light: 0.16,
9
9
  },
10
10
 
11
11
  boxShadow: {
12
12
  weak: '0px 4px 8px rgba(41, 41, 41, 0.08)',
13
13
  moderate: '0px 8px 24px rgba(41, 41, 41, 0.16)',
14
- intense: '0px 16px 32px rgba(41, 41, 41, 0.24)',
15
- strong: '0px 16px 48px rgba(41, 41, 41, 0.24)',
14
+ intense: '0px 16px 32px rgba(41, 41, 41, 0.32)',
15
+ strong: '0px 16px 48px rgba(41, 41, 41, 0.32)',
16
16
  },
17
17
  }
@@ -5,7 +5,7 @@ import spacing from './spacing'
5
5
  import effects from './effects'
6
6
  import misc from './miscs'
7
7
 
8
- import { debug, maxLines, outlinesForFocus, placeholder } from './utilities'
8
+ import { componentTypos ,debug, maxLines, outlinesForFocus, placeholder } from './utilities'
9
9
 
10
10
 
11
11
  export {
@@ -18,6 +18,7 @@ export {
18
18
  }
19
19
 
20
20
  export const utilities = {
21
+ componentTypos,
21
22
  outlinesForFocus,
22
23
  maxLines,
23
24
  debug,
@@ -14,6 +14,7 @@ export default {
14
14
  '2xl': '5rem',
15
15
  '3xl': '6rem',
16
16
  'mega': '7.5rem',
17
+ 'huge': '10rem',
17
18
  'giga': '12.5rem',
18
19
  },
19
20
 
@@ -32,6 +33,7 @@ export default {
32
33
  '2xl': '5rem',
33
34
  '3xl': '6rem',
34
35
  'mega': '7.5rem',
36
+ 'huge': '10rem',
35
37
  'giga': '12.5rem',
36
38
  },
37
39
 
@@ -50,6 +52,7 @@ export default {
50
52
  '2xl': '5rem',
51
53
  '3xl': '6rem',
52
54
  'mega': '7.5rem',
55
+ 'huge': '10rem',
53
56
  'giga': '12.5rem',
54
57
  },
55
58
  }
@@ -2,7 +2,7 @@ export default {
2
2
  fontFamily: {
3
3
  sans: ['"Lato"', 'sans-serif'],
4
4
  base: ['"Lato"', 'sans-serif'],
5
- title: ['"Rubik"'],
5
+ highlight: ['"Rubik"'],
6
6
  },
7
7
 
8
8
  fontSize: {
@@ -12,12 +12,13 @@ export default {
12
12
  'xs': '1.25rem',
13
13
 
14
14
  'sm': '1.5rem',
15
- 'md': '2rem',
16
- 'lg': '2.5rem',
15
+ 'md': '1.75rem',
16
+ 'lg': '2rem',
17
17
 
18
- 'xl': '3rem',
19
- '2xl': '3.5rem',
20
- '3xl': '4rem',
18
+ 'xl': '2.5rem',
19
+ '2xl': '3rem',
20
+ '3xl': '3.5rem',
21
+ 'huge': '4rem',
21
22
  'mega': '4.5rem',
22
23
  'giga': '5rem',
23
24
  },
@@ -26,7 +27,7 @@ export default {
26
27
  'default': 1,
27
28
 
28
29
  'xs': 1.15,
29
- 'sm': 1.2,
30
+ 'sm': 1.25,
30
31
 
31
32
  'md': 1.33,
32
33