@carbon/charts 1.9.0-next.1.0 → 1.9.0-next.2

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.
@@ -1,2 +1,2 @@
1
- export { createChartSandbox, createVanillaChartApp, createAngularChartApp, createReactChartApp, createSvelteChartApp, createVueChartApp } from './sandbox';
1
+ export { createVanillaChartApp, createAngularChartApp, createReactChartApp, createSvelteChartApp, createVueChartApp } from './sandbox';
2
2
  export { addControls, addOtherVersions, addRadioButtonEventListeners } from './story-widgets';
@@ -1,4 +1,3 @@
1
- export declare const createChartSandbox: (chartTemplate: any) => string;
2
1
  export declare const createVanillaChartApp: (demo: any) => {
3
2
  'index.html': string;
4
3
  'index.js': string;
@@ -10,7 +9,7 @@ export declare const createAngularChartApp: (demo: any) => {
10
9
  'tsconfig.json': string;
11
10
  'src/index.html': string;
12
11
  'src/main.ts': string;
13
- 'src/global_styles.css': string;
12
+ 'src/styles.css': string;
14
13
  };
15
14
  export declare const createReactChartApp: (demo: any) => {
16
15
  'public/index.html': string;
@@ -18,22 +17,22 @@ export declare const createReactChartApp: (demo: any) => {
18
17
  'package.json': string;
19
18
  };
20
19
  export declare const createSvelteChartApp: (demo: any) => {
21
- '.codesandbox/tasks.json': string;
22
- '.svelte-kit/tsconfig.json': string;
23
- 'src/app.html': string;
24
- 'src/app.d.ts': string;
25
- 'src/routes/+page.svelte': string;
26
- 'src/static/.gitkeep': string;
27
- '.npmrc': string;
20
+ 'src/App.svelte': string;
21
+ 'src/main.ts': string;
22
+ 'src/vite-env.d.ts': string;
23
+ '.stackblitzrc': string;
24
+ 'index.html': string;
28
25
  'package.json': string;
29
- 'README.md': string;
30
- 'sandbox.config.json': string;
31
26
  'svelte.config.js': string;
32
27
  'tsconfig.json': string;
28
+ 'tsconfig.node.json': string;
33
29
  'vite.config.ts': string;
34
30
  };
35
31
  export declare const createVueChartApp: (demo: any) => {
36
32
  'src/App.vue': string;
37
33
  'src/main.js': string;
34
+ '.stackblitzrc': string;
35
+ 'index.html': string;
38
36
  'package.json': string;
37
+ 'vite.config.js': string;
39
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/charts",
3
- "version": "1.9.0-next.1.0",
3
+ "version": "1.9.0-next.2",
4
4
  "description": "Carbon Charts component library",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "postinstall": "carbon-telemetry collect --install",
59
59
  "file:css:charts": "sass scss/index.scss dist/styles.css --load-path=./node_modules --load-path=../../node_modules",
60
60
  "file:css:min:charts": "sass scss/index.scss dist/styles.min.css --style=compressed --load-path=./node_modules --load-path=../../node_modules",
61
- "file:css:demo": "sass src/demo/styles.scss dist/demo/styles.css --load-path=./node_modules --load-path=../../node_modules",
61
+ "file:css:demo": "sass scss/demos.scss dist/demo/styles.css --load-path=./node_modules --load-path=../../node_modules",
62
62
  "file:downlevel:dts": "downlevel-dts dist dist",
63
63
  "postbundle": "concurrently \"yarn:file:*\"",
64
64
  "build:package": "vite build && yarn postbundle",
@@ -95,7 +95,7 @@
95
95
  "dom-to-image-more": "^3.1.6",
96
96
  "lodash-es": "^4.17.21",
97
97
  "resize-observer-polyfill": "^1.5.1",
98
- "topojson-client": "3.1.0",
98
+ "topojson-client": "^3.1.0",
99
99
  "tslib": "^2.5.3"
100
100
  },
101
101
  "peerDependencies": {
@@ -107,15 +107,15 @@
107
107
  "@babel/core": "^7.22.5",
108
108
  "@rushstack/eslint-patch": "^1.3.2",
109
109
  "@stackblitz/sdk": "^1.9.0",
110
- "@storybook/addon-essentials": "^7.0.22",
111
- "@storybook/addon-interactions": "^7.0.22",
112
- "@storybook/addon-links": "^7.0.22",
113
- "@storybook/blocks": "^7.0.22",
114
- "@storybook/html": "^7.0.22",
115
- "@storybook/html-vite": "^7.0.22",
116
- "@storybook/manager-api": "^7.0.22",
117
- "@storybook/testing-library": "^0.1.0",
118
- "@storybook/theming": "^7.0.22",
110
+ "@storybook/addon-essentials": "^7.0.23",
111
+ "@storybook/addon-interactions": "^7.0.23",
112
+ "@storybook/addon-links": "^7.0.23",
113
+ "@storybook/blocks": "^7.0.23",
114
+ "@storybook/html": "^7.0.23",
115
+ "@storybook/html-vite": "^7.0.23",
116
+ "@storybook/manager-api": "^7.0.23",
117
+ "@storybook/testing-library": "^0.2.0",
118
+ "@storybook/theming": "^7.0.23",
119
119
  "@types/d3": "^7.4.0",
120
120
  "@types/d3-cloud": "^1.2.5",
121
121
  "@types/d3-sankey": "^0.12.1",
@@ -123,7 +123,6 @@
123
123
  "@types/topojson": "^3.2.3",
124
124
  "@typescript-eslint/eslint-plugin": "^5.60.0",
125
125
  "@typescript-eslint/parser": "^5.60.0",
126
- "codesandbox": "^2.2.3",
127
126
  "concurrently": "^8.2.0",
128
127
  "downlevel-dts": "^0.11.0",
129
128
  "eslint": "^8.43.0",
@@ -133,8 +132,8 @@
133
132
  "prettier": "^2.8.8",
134
133
  "react": "^18.2.0",
135
134
  "react-dom": "^18.2.0",
136
- "sass": "^1.63.4",
137
- "storybook": "^7.0.22",
135
+ "sass": "^1.63.6",
136
+ "storybook": "^7.0.23",
138
137
  "typedoc": "^0.24.8",
139
138
  "typescript": "^5.1.3",
140
139
  "vite": "^4.3.9",
@@ -183,5 +182,5 @@
183
182
  "url": "https://github.com/theiliad"
184
183
  }
185
184
  ],
186
- "gitHead": "ff0e40a2e590e52dc1a25de96508def8f7758319"
185
+ "gitHead": "a45e6618f25fc3b8ce7547ca4c2724d8b049175b"
187
186
  }
package/scss/_colors.scss CHANGED
@@ -4,7 +4,7 @@
4
4
  @use '@carbon/styles/scss/themes';
5
5
  @use '@carbon/styles/scss/theme' as *;
6
6
 
7
- @import './color-palette.scss';
7
+ @import 'color-palette';
8
8
 
9
9
  @function generateCSSCustomProperty($token, $fallback) {
10
10
  @return var(--cds-charts-#{$token}, $fallback);
@@ -0,0 +1,427 @@
1
+ $charts-prefix: 'cc';
2
+
3
+ // Variables picked up by @carbon/styles/scss/config in imports
4
+ $prefix: 'cds'; // Default value
5
+ $css--default-type: false; // Do not include default type
6
+ $css--reset: false; // Do not include reset CSS
7
+
8
+ // IBM Plex font for demo is loaded in .storybook/preview-head.html - don't include here
9
+ @use '@carbon/styles/scss/config' with (
10
+ $css--font-face: false
11
+ );
12
+ @use '@carbon/styles'; // primarily needed for toolbar
13
+ @use '@carbon/styles/scss/type' as *; // used on line 230
14
+
15
+ // Custom charting tokens
16
+ @use '@carbon/styles/scss/theme';
17
+ @import 'tokens';
18
+ @include theme.add-component-tokens($custom-charting-tokens);
19
+ @import '@carbon/styles/scss/components/button/tokens.scss';
20
+
21
+ @mixin default_transition { // used by colors
22
+ transition: all 0.1s ease-out;
23
+ }
24
+ @import '@carbon/colors';
25
+ @import 'colors';
26
+
27
+ @import '@carbon/import-once/scss';
28
+ @import 'components';
29
+
30
+ @import 'graphs';
31
+ @import 'type';
32
+ @import 'chart-holder';
33
+
34
+ .#{$prefix}--#{$charts-prefix}--chart-wrapper {
35
+ overflow: visible;
36
+ }
37
+
38
+ html {
39
+ @include styles.theme(styles.$white);
40
+ }
41
+
42
+ html[data-carbon-theme='g10'] {
43
+ @include styles.theme(styles.$g10);
44
+ }
45
+
46
+ html[data-carbon-theme='g90'] {
47
+ @include styles.theme(styles.$g90);
48
+ }
49
+
50
+ html[data-carbon-theme='g100'] {
51
+ @include styles.theme(styles.$g100);
52
+ }
53
+
54
+ div.container {
55
+ color: theme.$text-primary;
56
+ background-color: theme.$background;
57
+ font-family: 'IBM Plex Sans', Arial, sans-serif;
58
+ padding: 30px;
59
+
60
+ div#color-palette-picker,
61
+ div#projection-picker {
62
+ max-width: 18rem;
63
+ margin-top: 2rem;
64
+ }
65
+
66
+ #chart-demo {
67
+ max-width: 700px;
68
+ }
69
+
70
+ .cds--grid {
71
+ padding: 0;
72
+
73
+ .cds--row .chart-demo {
74
+ margin-bottom: 60px;
75
+ }
76
+ }
77
+
78
+ h3 {
79
+ margin: 0;
80
+ font-weight: 700;
81
+
82
+ b.component {
83
+ margin-right: 10px;
84
+ }
85
+
86
+ span.cds--tag.component-name {
87
+ font-size: 0.55em;
88
+ vertical-align: middle;
89
+ padding: 0.25em 1em;
90
+ border-radius: 1em;
91
+ font-weight: 600;
92
+ }
93
+ }
94
+
95
+ div.theme-picker {
96
+ margin-top: 15px;
97
+ }
98
+
99
+ p.props {
100
+ b {
101
+ font-weight: 700;
102
+ }
103
+ }
104
+
105
+ // Replace with Carbon .scss imports
106
+ div.cds--snippet--multi {
107
+ background-color: black;
108
+ color: white;
109
+
110
+ pre {
111
+ padding: 2em !important;
112
+ -moz-tab-size: 4;
113
+ tab-size: 4;
114
+ line-height: 1.4;
115
+ }
116
+
117
+ .cds--snippet-container pre::after {
118
+ display: none;
119
+ }
120
+
121
+ .token.tag {
122
+ color: #6ea6ff;
123
+ }
124
+
125
+ .token.attr-name {
126
+ color: #92eeee;
127
+ }
128
+
129
+ .token.attr-value {
130
+ color: #bb8eff;
131
+ }
132
+ }
133
+
134
+ .cds--snippet--multi .cds--snippet-container pre code {
135
+ font-size: 14px;
136
+ }
137
+
138
+ .cds--snippet--multi.cds--snippet--expand .cds--snippet-container,
139
+ .cds--snippet--multi.cds--snippet--expand .cds--snippet-container pre {
140
+ padding-bottom: 0;
141
+ }
142
+
143
+ div.demo-desktop-only {
144
+ @media screen and (max-width: 768px) {
145
+ position: relative;
146
+ overflow: hidden;
147
+
148
+ &:before {
149
+ content: ' ';
150
+ display: block;
151
+ position: absolute;
152
+ z-index: 2;
153
+ top: 0;
154
+ left: 0;
155
+ background: #f4f4f4;
156
+ width: 100%;
157
+ height: 100%;
158
+ }
159
+ }
160
+
161
+ div.cp-message {
162
+ display: none;
163
+
164
+ @media screen and (max-width: 768px) {
165
+ position: absolute;
166
+ z-index: 2;
167
+ top: 50%;
168
+ left: 50%;
169
+ transform: translate(-50%, -50%);
170
+ display: block;
171
+ font-weight: bold;
172
+ text-align: center;
173
+ }
174
+ }
175
+ }
176
+
177
+ &.intro {
178
+ padding: 0;
179
+
180
+ .container-welcome {
181
+ padding: 0 !important;
182
+ }
183
+
184
+ .welcome__container {
185
+ width: 100vw;
186
+ min-height: 100vh;
187
+ padding: 3rem;
188
+ padding-bottom: 5rem;
189
+ background-color: #000;
190
+
191
+ @media screen and (max-width: 768px) {
192
+ &:before {
193
+ position: absolute;
194
+ display: block;
195
+ top: 0;
196
+ left: 0;
197
+ width: 100%;
198
+ height: 100%;
199
+ background: rgba(0, 0, 0, 0.45);
200
+ content: ' ';
201
+ z-index: 1;
202
+ }
203
+ }
204
+ }
205
+
206
+ .welcome__content {
207
+ position: relative;
208
+ z-index: 2;
209
+ }
210
+
211
+ .welcome__heading {
212
+ @include type-style('productive-heading-07');
213
+
214
+ color: theme.$text-inverse;
215
+ }
216
+
217
+ .welcome__heading--subtitle {
218
+ font-weight: 600;
219
+ }
220
+
221
+ .welcome__heading--other {
222
+ @include type-style('productive-heading-04');
223
+
224
+ font-weight: 600;
225
+ color: #4587fd;
226
+ }
227
+
228
+ h5 {
229
+ margin-top: 2em;
230
+ }
231
+
232
+ span.netlify {
233
+ position: fixed;
234
+ left: 0;
235
+ bottom: 0;
236
+ padding: 1em 1.5em;
237
+ padding-left: 3rem;
238
+ border-top-right-radius: 2em;
239
+ font-size: 13px;
240
+ vertical-align: middle;
241
+ background-color: #292929;
242
+ color: #bcbcbc;
243
+
244
+ a {
245
+ color: #fff;
246
+ font-weight: 700;
247
+ }
248
+ }
249
+ }
250
+
251
+ .marginTop {
252
+ margin-top: 10px;
253
+
254
+ &-15 {
255
+ margin-top: 15px;
256
+ }
257
+
258
+ &-30 {
259
+ margin-top: 30px;
260
+ }
261
+
262
+ &-45 {
263
+ margin-top: 45px;
264
+ }
265
+ }
266
+
267
+ hr {
268
+ margin-bottom: 75px;
269
+ margin-top: 25px;
270
+ }
271
+ }
272
+
273
+ .resource-card-group {
274
+ display: flex;
275
+ flex-wrap: wrap;
276
+ margin-left: 0;
277
+ margin-right: 0;
278
+ margin-top: 30px;
279
+ max-width: 700px;
280
+
281
+ .#{$prefix}--col-md-6.#{$prefix}--col-lg-6 {
282
+ border: 1px solid theme.$background;
283
+ padding: 0;
284
+ }
285
+
286
+ .#{$prefix}--col-lg-6 {
287
+ width: 100%;
288
+ }
289
+
290
+ @media (min-width: 42rem) {
291
+ .#{$prefix}--col-md-6 {
292
+ display: block;
293
+ max-width: 75%;
294
+ flex: 0 0 75%;
295
+ }
296
+ }
297
+
298
+ @media (min-width: 66rem) {
299
+ .#{$prefix}--col-lg-6 {
300
+ display: block;
301
+ max-width: 50%;
302
+ flex: 0 0 50%;
303
+ }
304
+ }
305
+ }
306
+
307
+ .#{$prefix}--aspect-ratio--object {
308
+ position: absolute;
309
+ top: 0;
310
+ left: 0;
311
+ width: 100%;
312
+ height: 100%;
313
+ }
314
+
315
+ .#{$prefix}--resource-card .#{$prefix}--tile {
316
+ background: theme.$layer-01;
317
+ height: 100%;
318
+ padding: 1rem 25% 1rem 1rem;
319
+ position: relative;
320
+ transition: background 70ms;
321
+ text-decoration: none;
322
+ }
323
+
324
+ .#{$prefix}--resource-card .#{$prefix}--tile:hover {
325
+ background: theme.$background-hover;
326
+ }
327
+
328
+ .#{$prefix}--resource-card__title {
329
+ @include type-style('productive-heading-03');
330
+ text-decoration: none;
331
+ color: theme.$text-primary;
332
+ }
333
+
334
+ .#{$prefix}--resource-card__subtitle {
335
+ @include type-style('heading-01');
336
+ font-weight: 400;
337
+ text-decoration: none;
338
+ color: theme.$text-primary;
339
+ }
340
+
341
+ .#{$prefix}--resource-card__icon--img {
342
+ position: absolute;
343
+ bottom: 1rem;
344
+ left: 1rem;
345
+ min-width: 32px;
346
+ min-height: 32px;
347
+ display: flex;
348
+ align-items: flex-end;
349
+ }
350
+
351
+ .#{$prefix}--resource-card__icon--img .gatsby-resp-image-wrapper,
352
+ .#{$prefix}--resource-card__icon--img img[src*='gif'],
353
+ .#{$prefix}--resource-card__icon--img img[src*='svg'] {
354
+ margin-bottom: 0;
355
+ }
356
+
357
+ .#{$prefix}--resource-card__icon--img .gatsby-resp-image-wrapper {
358
+ position: static !important; //important needed to override inline style added by Gatsby
359
+ }
360
+
361
+ .#{$prefix}--resource-card__icon--action {
362
+ position: absolute;
363
+ bottom: 1rem;
364
+ right: 1rem;
365
+ width: 20px;
366
+ height: 20px;
367
+ }
368
+
369
+ .#{$prefix}--resource-card .#{$prefix}--resource-card__icon--action svg {
370
+ fill: theme.$icon-primary;
371
+ }
372
+
373
+ // Dark
374
+ .#{$prefix}--resource-card--dark .#{$prefix}--tile {
375
+ background: $gray-90; //$background for gray 90 theme
376
+ }
377
+
378
+ .#{$prefix}--resource-card--dark .#{$prefix}--tile:hover {
379
+ background: $gray-80; //$background-hover for gray 90 theme
380
+ }
381
+
382
+ .#{$prefix}--resource-card--dark .#{$prefix}--resource-card__title,
383
+ .#{$prefix}--resource-card--dark .#{$prefix}--resource-card__subtitle {
384
+ color: theme.$text-on-color;
385
+ }
386
+
387
+ .#{$prefix}--resource-card--dark .#{$prefix}--resource-card__icon--action svg {
388
+ fill: $gray-10;
389
+ }
390
+
391
+ // Disabled
392
+ .#{$prefix}--resource-card--disabled .#{$prefix}--tile:hover {
393
+ background: theme.$layer-01;
394
+ cursor: not-allowed;
395
+ }
396
+
397
+ .#{$prefix}--resource-card--disabled .#{$prefix}--resource-card__title,
398
+ .#{$prefix}--resource-card--disabled .#{$prefix}--resource-card__subtitle {
399
+ color: theme.$icon-on-color-disabled;
400
+ }
401
+
402
+ .#{$prefix}--resource-card--disabled .#{$prefix}--resource-card__icon--action svg {
403
+ fill: theme.$icon-disabled;
404
+ }
405
+
406
+ .#{$prefix}--resource-card--disabled .#{$prefix}--resource-card__icon--img {
407
+ filter: grayscale(100%);
408
+ opacity: 0.5;
409
+ }
410
+
411
+ // Disabled dark
412
+ .#{$prefix}--resource-card--disabled.#{$prefix}--resource-card--dark .#{$prefix}--tile:hover {
413
+ background: $gray-90; //$background for gray 90 theme
414
+ }
415
+
416
+ .#{$prefix}--resource-card--disabled.#{$prefix}--resource-card--dark
417
+ .#{$prefix}--resource-card__title,
418
+ .#{$prefix}--resource-card--disabled.#{$prefix}--resource-card--dark
419
+ .#{$prefix}--resource-card__subtitle {
420
+ color: $gray-50; //$icon-on-color-disabled for gray 90
421
+ }
422
+
423
+ .#{$prefix}--resource-card--disabled.#{$prefix}--resource-card--dark
424
+ .#{$prefix}--resource-card__icon--action
425
+ svg {
426
+ fill: $gray-70; //$disabled-02 for gray 90
427
+ }
package/scss/index.scss CHANGED
@@ -9,7 +9,7 @@ $css--reset: false; // Do not include reset CSS
9
9
 
10
10
  // Custom charting tokens
11
11
  @use '@carbon/styles/scss/theme' as theme;
12
- @import './tokens';
12
+ @import 'tokens';
13
13
  @include theme.add-component-tokens($custom-charting-tokens);
14
14
  @import '@carbon/styles/scss/components/button/tokens';
15
15
 
@@ -17,14 +17,14 @@ $css--reset: false; // Do not include reset CSS
17
17
  transition: all 0.1s ease-out;
18
18
  }
19
19
  @import '@carbon/colors';
20
- @import './colors'; // mixins, color palette, color maps, tooltip and legend color settings
20
+ @import 'colors'; // mixins, color palette, color maps, tooltip and legend color settings
21
21
 
22
22
  @import '@carbon/import-once/scss'; // exports mixin
23
- @import './components'; // use exports mixin to ensure component modules only loaded once
23
+ @import 'components'; // use exports mixin to ensure component modules only loaded once
24
24
 
25
- @import './graphs'; // chart-specific
26
- @import './type'; // font size, fill, color, weight (but not family)
27
- @import './chart-holder'; // container settings
25
+ @import 'graphs'; // chart-specific
26
+ @import 'type'; // font size, fill, color, weight (but not family)
27
+ @import 'chart-holder'; // container settings
28
28
 
29
29
  .#{$prefix}--#{$charts-prefix}--chart-wrapper {
30
30
  overflow: visible;