@dscout/particle 1.0.0-alpha.2 → 1.0.0-alpha.3

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 (90) hide show
  1. package/lib/components/advanced_options.js +15 -3
  2. package/lib/components/attribute_input.js +15 -3
  3. package/lib/components/attribute_selector.js +14 -3
  4. package/lib/components/button.js +18 -6
  5. package/lib/components/button_control.js +15 -3
  6. package/lib/components/button_icon.js +142 -40
  7. package/lib/components/button_mode.js +18 -6
  8. package/lib/components/button_plain.js +16 -4
  9. package/lib/components/card.js +12 -2
  10. package/lib/components/checkbox_input.js +15 -3
  11. package/lib/components/collapsing_menu.js +15 -3
  12. package/lib/components/common_button.js +65 -5
  13. package/lib/components/common_input.js +15 -3
  14. package/lib/components/container.js +74 -14
  15. package/lib/components/container_header.js +2 -2
  16. package/lib/components/drag_and_drop.js +14 -3
  17. package/lib/components/dropdown_input_toggle.js +15 -4
  18. package/lib/components/editing_container.js +2 -3
  19. package/lib/components/email_input.js +15 -3
  20. package/lib/components/file_input.js +15 -3
  21. package/lib/components/link_text.js +283 -0
  22. package/lib/components/number_input.js +15 -3
  23. package/lib/components/password_input.js +15 -3
  24. package/lib/components/radio_input.js +15 -3
  25. package/lib/components/range_input.js +15 -3
  26. package/lib/components/search_input.js +15 -3
  27. package/lib/components/select_input.js +15 -3
  28. package/lib/components/tags_input.js +16 -3
  29. package/lib/components/text_input.js +15 -3
  30. package/lib/components/textarea.js +15 -3
  31. package/lib/components/togglable_fieldset.js +15 -3
  32. package/lib/components/toggle.js +15 -3
  33. package/lib/index.js +8 -16
  34. package/lib/stylesheets/particle.css +4495 -3192
  35. package/lib/stylesheets/particle.css.map +1 -0
  36. package/lib/stylesheets/particle.min.css +1 -1
  37. package/lib/stylesheets/particle.min.css.gz +0 -0
  38. package/lib/utils/data_attributes.js +18 -0
  39. package/lib/utils/markscout.js +2 -2
  40. package/package.json +29 -27
  41. package/styles/_base.scss +5 -8
  42. package/styles/_reset.scss +5 -0
  43. package/styles/components/_icons.scss +7 -14
  44. package/styles/components/attribute_selector/_base.scss +3 -3
  45. package/styles/components/button_icon/_base.scss +22 -0
  46. package/styles/components/button_icon/themes/_bandit.scss +5 -0
  47. package/styles/components/button_icon/themes/_researcher.scss +5 -0
  48. package/styles/components/button_icon/themes/_theme_builder.scss +12 -0
  49. package/styles/components/buttons/_base.scss +245 -382
  50. package/styles/components/buttons/themes/_bandit.scss +16 -16
  51. package/styles/components/buttons/themes/_theme_builder.scss +49 -73
  52. package/styles/components/card/_base.scss +0 -8
  53. package/styles/components/container/_base.scss +10 -20
  54. package/styles/components/container/themes/_theme_builder.scss +15 -14
  55. package/styles/components/footnote/_base.scss +1 -1
  56. package/styles/components/input_group/_base.scss +4 -4
  57. package/styles/components/link_text/_base.scss +52 -0
  58. package/styles/components/link_text/themes/_bandit.scss +5 -0
  59. package/styles/components/link_text/themes/_researcher.scss +5 -0
  60. package/styles/components/link_text/themes/_theme_builder.scss +11 -0
  61. package/styles/components/menu/_base.scss +2 -3
  62. package/styles/components/pill/_base.scss +13 -0
  63. package/styles/components/segmented_controls/_base.scss +1 -1
  64. package/styles/components/swappable/_base.scss +10 -2
  65. package/styles/particle.scss +2 -2
  66. package/styles/themes/_bandit.scss +40 -5
  67. package/styles/themes/_bandit_colors.scss +9 -0
  68. package/styles/themes/_researcher.scss +8 -5
  69. package/styles/themes/_researcher_colors.scss +91 -0
  70. package/styles/themes/_theme_builder.scss +215 -0
  71. package/styles/utilities/_alignment.scss +14 -137
  72. package/styles/utilities/_borders.scss +0 -44
  73. package/styles/utilities/_colors.scss +76 -605
  74. package/styles/utilities/_dimensions.scss +51 -265
  75. package/styles/utilities/_display.scss +1 -64
  76. package/styles/utilities/_overflow.scss +0 -55
  77. package/styles/utilities/_radii.scss +102 -30
  78. package/styles/utilities/_shadows.scss +0 -59
  79. package/styles/utilities/_spacing.scss +69 -534
  80. package/styles/utilities/_typography.scss +11 -333
  81. package/CHANGELOG.md +0 -1548
  82. package/lib/components/container_inner.js +0 -93
  83. package/lib/components/controls.js +0 -106
  84. package/styles/_mixins.scss +0 -134
  85. package/styles/_tables.scss +0 -138
  86. package/styles/_theme_builder.scss +0 -356
  87. package/styles/_variables.scss +0 -248
  88. package/styles/components/_links.scss +0 -141
  89. package/styles/css_variables/_bandit.scss +0 -45
  90. package/styles/css_variables/_researcher.scss +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dscout/particle",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "A pattern library for building dscout user interfaces",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -10,10 +10,8 @@
10
10
  "scripts": {
11
11
  "build": "script/build",
12
12
  "build-docs": "script/build-docs",
13
- "build-styleguide": "script/build-styleguide",
14
13
  "ci": "script/ci",
15
14
  "clean": "script/clean",
16
- "styleguide": "webpack-dev-server --config .styleguide/webpack.config.js --output-path .styleguide/dist --env development",
17
15
  "lint": "script/lint",
18
16
  "nano": "script/nano",
19
17
  "prebuild": "script/clean",
@@ -48,24 +46,26 @@
48
46
  "@babel/core": "^7.11.5",
49
47
  "@babel/preset-env": "^7.11.5",
50
48
  "@babel/preset-react": "^7.0.0",
51
- "@storybook/addon-actions": "^6.2.9",
52
- "@storybook/addon-controls": "6.2.9",
53
- "@storybook/addon-docs": "6.2.9",
54
- "@storybook/addon-links": "^6.2.9",
55
- "@storybook/addon-toolbars": "6.2.9",
56
- "@storybook/addon-viewport": "^6.2.9",
57
- "@storybook/addons": "^6.2.9",
58
- "@storybook/react": "^6.2.9",
59
- "autoprefixer": "^7.1.4",
49
+ "@storybook/addon-actions": "6.3.13",
50
+ "@storybook/addon-controls": "6.3.13",
51
+ "@storybook/addon-docs": "6.3.13",
52
+ "@storybook/addon-links": "6.3.13",
53
+ "@storybook/addon-toolbars": "6.3.13",
54
+ "@storybook/addon-viewport": "6.3.13",
55
+ "@storybook/addons": "6.3.13",
56
+ "@storybook/builder-webpack5": "6.3.13",
57
+ "@storybook/manager-webpack5": "6.3.13",
58
+ "@storybook/react": "6.3.13",
59
+ "autoprefixer": "^10.4.4",
60
60
  "babel-eslint": "^9.0.0",
61
- "babel-loader": "^8.0.5",
61
+ "babel-loader": "^8.2.3",
62
62
  "babel-plugin-transform-object-rest-spread": "^6.26.0",
63
63
  "chai": "^3.5.0",
64
64
  "chai-enzyme": "^1.0.0-beta.0",
65
65
  "cheerio": "^0.22.0",
66
66
  "core-js": "3",
67
- "css-loader": "^2.1.1",
68
- "cssnano": "^3.10.0",
67
+ "css-loader": "^6.7.1",
68
+ "cssnano": "^5.1.3",
69
69
  "enzyme": "3.3.0",
70
70
  "enzyme-adapter-react-16": "^1.12.1",
71
71
  "eslint": "^3.19.0",
@@ -76,33 +76,34 @@
76
76
  "eslint-plugin-jsx-a11y": "^4.0.0",
77
77
  "eslint-plugin-prettier": "^2.0.1",
78
78
  "eslint-plugin-react": "^6.10.3",
79
- "file-loader": "^6.0.0",
79
+ "file-loader": "^6.2.0",
80
80
  "husky": "^1.3.1",
81
81
  "karma": "^1.5.0",
82
82
  "karma-chai-sinon": "^0.1.5",
83
83
  "karma-chrome-launcher": "^2.2.0",
84
84
  "karma-mocha": "^1.3.0",
85
- "karma-webpack": "5.0.0-alpha.3.0",
85
+ "karma-webpack": "5.0.0",
86
86
  "lint-staged": "^8.0.1",
87
87
  "mini-css-extract-plugin": "^1.6.0",
88
88
  "mocha": "^3.2.0",
89
- "node-sass": "^4.1.0",
90
- "postcss-cli": "^3.0.0",
89
+ "postcss": "^8.4.8",
90
+ "postcss-cli": "^9.1.0",
91
91
  "postcss-discard-comments": "^2.0.4",
92
- "postcss-loader": "^3.0.0",
93
- "postcss-style-guide": "^0.13.0",
92
+ "postcss-loader": "^6.2.1",
94
93
  "prettier": "^1.3.1",
95
94
  "prop-types": "^15.7.2",
96
95
  "react": "^16.13.1",
97
96
  "react-dom": "^16.13.1",
98
- "sass-loader": "^7.1.0",
97
+ "sass": "^1.49.9",
98
+ "sass-loader": "^12.2.0",
99
99
  "sinon": "4.1.3",
100
100
  "sinon-chai": "2.14.0",
101
- "style-loader": "^0.23.1",
101
+ "stream-browserify": "^3.0.0",
102
+ "style-loader": "^3.3.1",
102
103
  "typescript": "^4.3.5",
103
- "webpack": "^4.41.2",
104
- "webpack-cli": "^3.3.10",
105
- "webpack-dev-server": "^3.11.2"
104
+ "webpack": "^5.70.0",
105
+ "webpack-cli": "^4.9.2",
106
+ "webpack-dev-server": "^4.7.4"
106
107
  },
107
108
  "peerDependencies": {
108
109
  "prop-types": "^15.5.0",
@@ -122,7 +123,8 @@
122
123
  ]
123
124
  },
124
125
  "ignore": [
125
- "docs/**"
126
+ "docs/**",
127
+ "documentation/**"
126
128
  ]
127
129
  }
128
130
  }
package/styles/_base.scss CHANGED
@@ -1,6 +1,3 @@
1
- @import 'mixins';
2
- @import 'variables';
3
-
4
1
  html,
5
2
  body {
6
3
  height: 100%;
@@ -14,11 +11,11 @@ html {
14
11
  }
15
12
 
16
13
  body {
17
- background-color: var(--Body__bg-color);
18
- color: var(--Body__color);
19
- font-family: var(--Body__font-family);
20
- font-size: var(--Body__font-size);
21
- line-height: var(--Body__line-height);
14
+ background-color: var(--base____bg-color);
15
+ color: var(--base____color);
16
+ font-family: var(--base____font-family);
17
+ font-size: var(--base____font-size);
18
+ line-height: var(--base____line-height);
22
19
  margin: 0;
23
20
  padding: 0;
24
21
  -webkit-font-smoothing: antialiased;
@@ -59,3 +59,8 @@ fieldset {
59
59
  border: none;
60
60
  padding: 0;
61
61
  }
62
+
63
+ a {
64
+ color: inherit;
65
+ text-decoration: inherit;
66
+ }
@@ -1,15 +1,12 @@
1
- @import '../mixins';
2
-
3
1
  @keyframes rotate {
4
2
  0% { transform: rotate(0deg); }
5
3
  100% { transform: rotate(360deg); }
6
4
  }
7
5
 
8
6
  .icon {
9
- @include vert;
10
-
11
7
  height: 1.563rem;
12
8
  width: 1.563rem;
9
+ vertical-align: middle;
13
10
 
14
11
  &.icon--tight {
15
12
  width: auto;
@@ -21,36 +18,32 @@
21
18
  }
22
19
 
23
20
  .icon--2 {
24
- @include vert;
25
-
26
21
  height: 3.125rem;
27
22
  width: 3.125rem;
23
+ vertical-align: middle;
28
24
  }
29
25
 
30
- .icon--3 {
31
- @include vert;
32
-
26
+ .icon--3 {
33
27
  height: 4.688rem;
34
28
  width: 4.688rem;
29
+ vertical-align: middle;
35
30
  }
36
31
 
37
32
  .icon--4 {
38
- @include vert;
39
-
40
33
  height: 6.25rem;
41
34
  width: 6.25rem;
35
+ vertical-align: middle;
42
36
  }
43
37
 
44
38
  .icon--export {
45
- @include vert;
46
-
47
39
  height: 63px;
48
40
  width: 48px;
41
+ vertical-align: middle;
49
42
  }
50
43
 
51
44
  .count-icon {
52
45
  .count-icon--count {
53
- font-size: $font-size--s;
46
+ font-size: var(--font-size--s);
54
47
  }
55
48
 
56
49
  .count-icon--icon {
@@ -34,8 +34,8 @@
34
34
  }
35
35
 
36
36
  .Attribute__Label {
37
- @include border(var(--Attribute____border-width), var(--Attribute____border-color));
38
37
  background: none;
38
+ border: var(--Attribute____border-width) solid var(--Attribute____border-color);
39
39
  border-radius: var(--Attribute____border-radius);
40
40
  color: var(--Attribute____color);
41
41
  cursor: pointer;
@@ -46,7 +46,7 @@
46
46
  transition: border var(--timing--hover), color var(--timing--hover);
47
47
 
48
48
  &:hover {
49
- @include border(var(--Attribute____border-width), var(--Attribute--hover____border-color));
49
+ border: var(--Attribute____border-width) solid var(--Attribute--hover____border-color);
50
50
  color: var(--Attribute--hover____color)
51
51
  }
52
52
 
@@ -57,4 +57,4 @@
57
57
  color: var(--Attribute--selected____color);
58
58
  cursor: default;
59
59
  }
60
- }
60
+ }
@@ -0,0 +1,22 @@
1
+ @import 'themes/bandit';
2
+ @import 'themes/researcher';
3
+
4
+ .Button-Icon {
5
+ align-items: center;
6
+ // This background color may look weird, but it's critical for supporting
7
+ // background transitions starting or ending with a transparent background.
8
+ background-color: var(--color--none);
9
+ border: none;
10
+ border-radius: var(--Button-Icon____radius);
11
+ cursor: pointer;
12
+ display: inline-flex;
13
+ font-size: inherit;
14
+ justify-content: center;
15
+ transition-property: background, color, height, width;
16
+ transition-duration: var(--Button-Icon____transition-duration);
17
+
18
+ &[disabled] {
19
+ cursor: default;
20
+ pointer-events: none;
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ @import 'theme_builder';
2
+
3
+ .theme--bandit {
4
+ @include generate-button-icon-theme-variables();
5
+ }
@@ -0,0 +1,5 @@
1
+ @import 'theme_builder';
2
+
3
+ .theme--researcher {
4
+ @include generate-button-icon-theme-variables();
5
+ }
@@ -0,0 +1,12 @@
1
+ $default-variables: (
2
+ "Button-Icon____radius": var(--radius--circle),
3
+ "Button-Icon____transition-duration": var(--timing--hover)
4
+ );
5
+
6
+ @mixin generate-button-icon-theme-variables($theme-variables: ()) {
7
+ $variables: map-merge($default-variables, $theme-variables);
8
+
9
+ @each $name, $value in $variables {
10
+ --#{$name}: #{$value};
11
+ }
12
+ }