@dscout/particle 1.0.0-alpha.13 → 1.0.0-alpha.15

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 (48) hide show
  1. package/lib/cjs/components/checkbox_input.d.ts +3 -2
  2. package/lib/cjs/components/checkbox_input.js +2 -2
  3. package/lib/cjs/components/checkbox_input.js.map +1 -1
  4. package/lib/cjs/components/dropdown.d.ts +2 -1
  5. package/lib/cjs/components/dropdown.js +4 -3
  6. package/lib/cjs/components/dropdown.js.map +1 -1
  7. package/lib/cjs/components/radio_input.d.ts +3 -2
  8. package/lib/cjs/components/radio_input.js +2 -2
  9. package/lib/cjs/components/radio_input.js.map +1 -1
  10. package/lib/cjs/components/textarea.d.ts +2 -1
  11. package/lib/cjs/components/textarea.js +2 -2
  12. package/lib/cjs/components/textarea.js.map +1 -1
  13. package/lib/cjs/components/toggle.d.ts +4 -2
  14. package/lib/cjs/components/toggle.js +3 -2
  15. package/lib/cjs/components/toggle.js.map +1 -1
  16. package/lib/cjs/types.d.ts +2 -1
  17. package/lib/esm/components/checkbox_input.d.ts +3 -2
  18. package/lib/esm/components/checkbox_input.js +2 -2
  19. package/lib/esm/components/checkbox_input.js.map +1 -1
  20. package/lib/esm/components/dropdown.d.ts +2 -1
  21. package/lib/esm/components/dropdown.js +4 -3
  22. package/lib/esm/components/dropdown.js.map +1 -1
  23. package/lib/esm/components/radio_input.d.ts +3 -2
  24. package/lib/esm/components/radio_input.js +2 -2
  25. package/lib/esm/components/radio_input.js.map +1 -1
  26. package/lib/esm/components/textarea.d.ts +2 -1
  27. package/lib/esm/components/textarea.js +2 -2
  28. package/lib/esm/components/textarea.js.map +1 -1
  29. package/lib/esm/components/toggle.d.ts +4 -2
  30. package/lib/esm/components/toggle.js +3 -2
  31. package/lib/esm/components/toggle.js.map +1 -1
  32. package/lib/esm/types.d.ts +2 -1
  33. package/lib/stylesheets/particle.css +119 -24
  34. package/lib/stylesheets/particle.css.map +1 -1
  35. package/lib/stylesheets/particle.min.css +1 -1
  36. package/lib/stylesheets/particle.min.css.gz +0 -0
  37. package/package.json +2 -1
  38. package/styles/color_schemes/_ai_colors.scss +1 -0
  39. package/styles/color_schemes/_color_scheme_builder.scss +1 -0
  40. package/styles/components/selectors/_base.scss +1 -1
  41. package/styles/components/selectors/themes/_bandit.scss +0 -8
  42. package/styles/components/selectors/themes/_theme_builder.scss +4 -4
  43. package/styles/components/toggle/_base.scss +16 -2
  44. package/styles/components/toggle/themes/_bandit.scss +0 -1
  45. package/styles/components/toggle/themes/_express.scss +27 -0
  46. package/styles/components/toggle/themes/_theme_builder.scss +1 -1
  47. package/styles/utilities/_colors.scss +1 -0
  48. package/styles/utilities/_typography.scss +50 -10
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dscout/particle",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.15",
4
4
  "description": "A pattern library for building dscout user interfaces",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -50,6 +50,7 @@
50
50
  "@babel/preset-env": "^7.11.5",
51
51
  "@babel/preset-react": "^7.0.0",
52
52
  "@babel/preset-typescript": "^7.21.5",
53
+ "@figma/code-connect": "^0.1.1",
53
54
  "@storybook/addon-actions": "6.3.13",
54
55
  "@storybook/addon-controls": "6.3.13",
55
56
  "@storybook/addon-docs": "6.3.13",
@@ -16,6 +16,7 @@ $color--ai-pink-800: #541633;
16
16
 
17
17
  $gradient--ai-a: linear-gradient(to right, #F66DB0, #B55BF5);
18
18
  $gradient--ai-light-a: linear-gradient(to right, #F7F1FF, #FFF8FC);
19
+ $gradient--ai-reverse-a: linear-gradient(to right, #B55BF5, #F66DB0);
19
20
 
20
21
  $gradient--ai-b: linear-gradient(to right, #1E1D40, #322D68);
21
22
  $gradient--ai-light-b: linear-gradient(to right, #F2F2FF, #F7F6FF);
@@ -306,6 +306,7 @@
306
306
 
307
307
  "gradient--ai-light-a": get-gradient($colors, 'ai-light-a'),
308
308
  "gradient--ai-a": get-gradient($colors, 'ai-a'),
309
+ "gradient--ai-reverse-a": get-gradient($colors, 'ai-reverse-a'),
309
310
 
310
311
  "gradient--ai-light-b": get-gradient($colors, 'ai-light-b'),
311
312
  "gradient--ai-b": get-gradient($colors, 'ai-b'),
@@ -62,7 +62,7 @@
62
62
  outline: none;
63
63
 
64
64
  & + .Selector__Field {
65
- outline: var(--color--dscout) auto 5px;
65
+ outline: currentColor solid 2px;
66
66
  }
67
67
  }
68
68
  }
@@ -5,11 +5,7 @@
5
5
  (
6
6
  "Selector__Label____top-offset": -.05em,
7
7
 
8
- "Radio--unchecked____bg-color": transparent,
9
- "Radio--checked____bg-color": var(--color--dscout),
10
-
11
8
  "Radio--unchecked____border-color": var(--color--gray-3),
12
- "Radio--checked____border-color": var(--color--dscout),
13
9
 
14
10
  "Radio--unchecked____border-width": 2px,
15
11
  "Radio--checked____border-width": 2px,
@@ -26,11 +22,7 @@
26
22
  "Radio--unchecked__Icon____color": transparent,
27
23
  "Radio--checked__Icon____color": var(--color--invert),
28
24
 
29
- "Checkbox--unchecked____bg-color": transparent,
30
- "Checkbox--checked____bg-color": var(--color--dscout),
31
-
32
25
  "Checkbox--unchecked____border-color": var(--color--gray-3),
33
- "Checkbox--checked____border-color": var(--color--dscout),
34
26
 
35
27
  "Checkbox--unchecked____border-width": 2px,
36
28
  "Checkbox--checked____border-width": 2px,
@@ -4,10 +4,10 @@ $default-variables: (
4
4
  "Selector__Label____padding-left": 1em,
5
5
 
6
6
  "Radio--unchecked____bg-color": transparent,
7
- "Radio--checked____bg-color": var(--color--dscout),
7
+ "Radio--checked____bg-color": currentColor,
8
8
 
9
9
  "Radio--unchecked____border-color": rgba(var(--color--main-rgb), .2),
10
- "Radio--checked____border-color": var(--color--dscout),
10
+ "Radio--checked____border-color": currentColor,
11
11
 
12
12
  "Radio--unchecked____border-width": 1px,
13
13
  "Radio--checked____border-width": 1px,
@@ -23,10 +23,10 @@ $default-variables: (
23
23
  "Radio--checked__Icon____color": transparent,
24
24
 
25
25
  "Checkbox--unchecked____bg-color": transparent,
26
- "Checkbox--checked____bg-color": var(--color--dscout),
26
+ "Checkbox--checked____bg-color": currentColor,
27
27
 
28
28
  "Checkbox--unchecked____border-color": rgba(var(--color--main-rgb), .2),
29
- "Checkbox--checked____border-color": var(--color--dscout),
29
+ "Checkbox--checked____border-color": currentColor,
30
30
 
31
31
  "Checkbox--unchecked____border-width": 1px,
32
32
  "Checkbox--checked____border-width": 1px,
@@ -1,5 +1,6 @@
1
1
  @import 'themes/default';
2
2
  @import 'themes/bandit';
3
+ @import 'themes/express';
3
4
 
4
5
  .Toggle {
5
6
  display: inline-block;
@@ -21,6 +22,7 @@
21
22
  position: relative;
22
23
  text-indent: -5000px;
23
24
  width: var(--Toggle__Track____width);
25
+ cursor: pointer;
24
26
 
25
27
  // Track fill
26
28
  &::before {
@@ -61,7 +63,7 @@
61
63
  &:checked + .Toggle__Track {
62
64
  // Track fill
63
65
  &::before {
64
- background-color: var(--Toggle--checked__Track____bg-color);
66
+ background-color: currentColor;
65
67
  width: var(--Toggle--checked__Track____fill-width);
66
68
  }
67
69
 
@@ -75,9 +77,21 @@
75
77
 
76
78
  &:disabled + .Toggle__Track {
77
79
  opacity: .3;
80
+ cursor: auto;
78
81
  }
79
82
 
80
83
  &:focus + .Toggle__Track {
81
- outline: var(--color--dscout) auto 5px;
84
+ outline: currentColor auto 5px;
85
+ }
86
+ }
87
+
88
+ .Toggle.Toggle--ai {
89
+ .Toggle__Checkbox {
90
+ &:checked + .Toggle__Track {
91
+ // Track fill
92
+ &::before {
93
+ background: var(--gradient--ai-reverse-a);
94
+ }
95
+ }
82
96
  }
83
97
  }
@@ -19,7 +19,6 @@
19
19
  "Toggle__Track____radius": var(--radius--pill),
20
20
  "Toggle__Track____shadow": none,
21
21
  "Toggle--unchecked__Track____bg-color": var(--color--gray-3),
22
- "Toggle--checked__Track____bg-color": var(--color--dscout),
23
22
  "Toggle--unchecked__Track____fill-width": var(--Toggle__Track____width),
24
23
  "Toggle--checked__Track____fill-width": var(--Toggle__Track____width),
25
24
  "Toggle__Track____transition-duration": var(--timing--click),
@@ -0,0 +1,27 @@
1
+ @import 'theme_builder';
2
+
3
+ .theme--express {
4
+ @include generate-toggle-theme-variables(
5
+ (
6
+ "Toggle__Switch____height": 1em,
7
+ "Toggle__Switch____width": 1em,
8
+ "Toggle__Switch____radius": var(--radius--pill),
9
+ "Toggle--unchecked__Switch____shadow": none,
10
+ "Toggle--checked__Switch____shadow": none,
11
+ "Toggle--unchecked__Switch____bg-color": var(--color--invert),
12
+ "Toggle--checked__Switch____bg-color": var(--color--invert),
13
+ "Toggle__Switch____transition-duration": var(--timing--click),
14
+ "Toggle__Switch____top": calc((var(--Toggle__Track____height) - var(--Toggle__Switch____height)) / 2),
15
+ "Toggle__Switch____left": var(--Toggle__Switch____top),
16
+
17
+ "Toggle__Track____height": 1.3em,
18
+ "Toggle__Track____width": 2em,
19
+ "Toggle__Track____radius": var(--radius--pill),
20
+ "Toggle__Track____shadow": none,
21
+ "Toggle--unchecked__Track____bg-color": var(--color--gray-3),
22
+ "Toggle--unchecked__Track____fill-width": var(--Toggle__Track____width),
23
+ "Toggle--checked__Track____fill-width": var(--Toggle__Track____width),
24
+ "Toggle__Track____transition-duration": var(--timing--click),
25
+ )
26
+ );
27
+ }
@@ -9,7 +9,7 @@ $default-variables: (
9
9
  "Toggle--unchecked__Switch____shadow": (inset 0 0 0 1px rgba(var(--color--main-rgb), 0.2), 0 2px 4px rgba(var(--color--main-rgb), 0.15)),
10
10
  "Toggle--unchecked__Switch____bg-color": var(--color--invert),
11
11
 
12
- "Toggle--checked__Switch____shadow": (inset 0 0 0 1px var(--color--dscout), 0 2px 4px rgba(var(--color--main-rgb), 0.2)),
12
+ "Toggle--checked__Switch____shadow": (inset 0 0 0 1px currentColor, 0 2px 4px rgba(var(--color--main-rgb), 0.2)),
13
13
  "Toggle--checked__Switch____bg-color": var(--color--invert),
14
14
 
15
15
  "Toggle__Track____height": 1.5em,
@@ -185,6 +185,7 @@ $colors: (
185
185
  $gradients: (
186
186
  'ai-light-a',
187
187
  'ai-a',
188
+ 'ai-reverse-a',
188
189
 
189
190
  'ai-light-b',
190
191
  'ai-b',
@@ -1,3 +1,12 @@
1
+ @mixin line-clamp {
2
+ overflow: hidden;
3
+ display: -webkit-box;
4
+ -webkit-box-orient: vertical;
5
+ text-align: left;
6
+ word-wrap: anywhere;
7
+ }
8
+
9
+
1
10
  /*=== Font size ===*/
2
11
 
3
12
  .font-size--xxs { font-size: var(--font-size--xxs); }
@@ -62,31 +71,62 @@
62
71
  .text-transform--u { text-transform: uppercase; }
63
72
  .text-transform--l { text-transform: lowercase; }
64
73
 
74
+ /*=== Text decoration ===*/
75
+
76
+ .text-decoration--none { text-decoration: none; }
77
+ .text-decoration--underline { text-decoration: underline; }
65
78
 
79
+ /*=== Text layout ===*/
66
80
  /*=== Whitespace ===*/
67
81
 
68
82
  .white-space--pre-wrap { white-space: pre-wrap; }
69
83
  .white-space--nowrap { white-space: nowrap; }
70
84
  .white-space--pre-line { white-space: pre-line; }
71
85
 
72
-
73
- /*=== Text decoration ===*/
74
-
75
- .text-decoration--none { text-decoration: none; }
76
- .text-decoration--underline { text-decoration: underline; }
77
-
78
-
79
86
  /*=== Line wrap ===*/
80
-
81
87
  .line-wrap {
82
88
  overflow-wrap: break-word;
83
89
  hyphens: auto;
84
90
  }
85
91
 
86
- /*=== Truncate ===*/
87
-
92
+ /*=== Simple Truncate ===*/
88
93
  .truncate {
89
94
  overflow: hidden;
90
95
  text-overflow: ellipsis;
91
96
  white-space: nowrap;
92
97
  }
98
+
99
+ /*=== Line Clamp ===*/
100
+ .line-clamp--1 {
101
+ @include line-clamp;
102
+ -webkit-line-clamp: 1;
103
+ }
104
+
105
+ .line-clamp--2 {
106
+ @include line-clamp;
107
+ -webkit-line-clamp: 2;
108
+ }
109
+
110
+ .line-clamp--3 {
111
+ @include line-clamp;
112
+ -webkit-line-clamp: 3;
113
+ }
114
+
115
+ .line-clamp--4 {
116
+ @include line-clamp;
117
+ -webkit-line-clamp: 4;
118
+ }
119
+
120
+ .line-clamp--5 {
121
+ @include line-clamp;
122
+ -webkit-line-clamp: 5;
123
+ }
124
+
125
+ .line-clamp--6 {
126
+ @include line-clamp;
127
+ -webkit-line-clamp: 6;
128
+ }
129
+
130
+ .line-clamp--none {
131
+ -webkit-line-clamp: none;
132
+ }