@instructure/ui-view 11.7.4-snapshot-106 → 11.7.4-snapshot-108
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.
- package/CHANGELOG.md +2 -1
- package/es/View/v2/styles.js +86 -5
- package/lib/View/v2/styles.js +86 -5
- package/package.json +12 -12
- package/src/ContextView/v1/props.ts +1 -2
- package/src/View/v1/props.ts +2 -4
- package/src/View/v2/README.md +110 -31
- package/src/View/v2/props.ts +20 -4
- package/src/View/v2/styles.ts +89 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/ContextView/v1/index.d.ts +1 -1
- package/types/ContextView/v1/props.d.ts +2 -2
- package/types/ContextView/v1/props.d.ts.map +1 -1
- package/types/View/v1/props.d.ts +3 -3
- package/types/View/v1/props.d.ts.map +1 -1
- package/types/View/v2/props.d.ts +5 -4
- package/types/View/v2/props.d.ts.map +1 -1
- package/types/View/v2/styles.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [11.7.4-snapshot-
|
|
6
|
+
## [11.7.4-snapshot-108](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-snapshot-108) (2026-07-16)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Features
|
|
10
10
|
|
|
11
|
+
* **many:** add prop most shared tokens to prop options in view ([a08bb3e](https://github.com/instructure/instructure-ui/commit/a08bb3e15759681c5247c8bf27b7a87fa0766dde))
|
|
11
12
|
* **many:** remove deprecated v2 items ([eaf8876](https://github.com/instructure/instructure-ui/commit/eaf88767c9beb95c4e09ee5705c387dfd79e4cb7))
|
|
12
13
|
* **many:** support current spacing tokens in the margin prop for v2 components ([1b47c5f](https://github.com/instructure/instructure-ui/commit/1b47c5f23eaa60b532cdfd53c39bd71f0cf51aaa))
|
|
13
14
|
|
package/es/View/v2/styles.js
CHANGED
|
@@ -38,10 +38,25 @@ const processBorderRadiusValue = (value, sharedTokens) => {
|
|
|
38
38
|
if (v === 'circle') return '100%';
|
|
39
39
|
if (v === 'pill') return '999em';
|
|
40
40
|
|
|
41
|
+
// Handle legacy values
|
|
42
|
+
if (v === 'small') return sharedTokens.legacy.radiusSmall;
|
|
43
|
+
if (v === 'medium') return sharedTokens.legacy.radiusMedium;
|
|
44
|
+
if (v === 'large') return sharedTokens.legacy.radiusLarge;
|
|
45
|
+
|
|
41
46
|
// Handle SharedTokens values
|
|
42
|
-
if (v === '
|
|
43
|
-
if (v === '
|
|
44
|
-
if (v === '
|
|
47
|
+
if (v === 'xxl') return sharedTokens.borderRadius.xxl;
|
|
48
|
+
if (v === 'xl') return sharedTokens.borderRadius.xl;
|
|
49
|
+
if (v === 'lg') return sharedTokens.borderRadius.lg;
|
|
50
|
+
if (v === 'md') return sharedTokens.borderRadius.md;
|
|
51
|
+
if (v === 'sm') return sharedTokens.borderRadius.sm;
|
|
52
|
+
if (v === 'xs') return sharedTokens.borderRadius.xs;
|
|
53
|
+
if (v === 'full') return sharedTokens.borderRadius.full;
|
|
54
|
+
if (v === 'card.nestedContainer.sm') return sharedTokens.borderRadius.card.nestedContainer.sm;
|
|
55
|
+
if (v === 'card.nestedContainer.md') return sharedTokens.borderRadius.card.nestedContainer.md;
|
|
56
|
+
if (v === 'card.nestedContainer.lg') return sharedTokens.borderRadius.card.nestedContainer.lg;
|
|
57
|
+
if (v === 'card.sm') return sharedTokens.borderRadius.card.sm;
|
|
58
|
+
if (v === 'card.md') return sharedTokens.borderRadius.card.md;
|
|
59
|
+
if (v === 'card.lg') return sharedTokens.borderRadius.card.lg;
|
|
45
60
|
|
|
46
61
|
// Pass through CSS values (1rem, 12px, etc.)
|
|
47
62
|
return v;
|
|
@@ -58,11 +73,16 @@ const processBorderWidthValue = (value, sharedTokens) => {
|
|
|
58
73
|
if (v === 'auto' || v === '0') return v;
|
|
59
74
|
if (v === 'none') return '0';
|
|
60
75
|
|
|
61
|
-
// Handle
|
|
76
|
+
// Handle legacy values
|
|
62
77
|
if (v === 'small') return sharedTokens.strokeWidth.sm;
|
|
63
78
|
if (v === 'medium') return sharedTokens.strokeWidth.md;
|
|
64
79
|
if (v === 'large') return sharedTokens.strokeWidth.lg;
|
|
65
80
|
|
|
81
|
+
// Handle SharedTokens values
|
|
82
|
+
if (v === 'sm') return sharedTokens.strokeWidth.sm;
|
|
83
|
+
if (v === 'md') return sharedTokens.strokeWidth.md;
|
|
84
|
+
if (v === 'lg') return sharedTokens.strokeWidth.lg;
|
|
85
|
+
|
|
66
86
|
// Pass through CSS values (1rem, 2px, etc.)
|
|
67
87
|
return v;
|
|
68
88
|
});
|
|
@@ -267,6 +287,7 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
267
287
|
}
|
|
268
288
|
};
|
|
269
289
|
const borderColorVariants = {
|
|
290
|
+
//legacy colors
|
|
270
291
|
transparent: {
|
|
271
292
|
borderColor: componentTheme.borderColorTransparent
|
|
272
293
|
},
|
|
@@ -293,6 +314,52 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
293
314
|
},
|
|
294
315
|
danger: {
|
|
295
316
|
borderColor: componentTheme.borderColorDanger
|
|
317
|
+
},
|
|
318
|
+
//new colors
|
|
319
|
+
strongColor: {
|
|
320
|
+
borderColor: sharedTokens.stroke.strongColor
|
|
321
|
+
},
|
|
322
|
+
visualSeparator: {
|
|
323
|
+
borderColor: sharedTokens.stroke.visualSeparator
|
|
324
|
+
},
|
|
325
|
+
accentAsh: {
|
|
326
|
+
borderColor: sharedTokens.stroke.accentAsh
|
|
327
|
+
},
|
|
328
|
+
accentAurora: {
|
|
329
|
+
borderColor: sharedTokens.stroke.accentAurora
|
|
330
|
+
},
|
|
331
|
+
accentBlue: {
|
|
332
|
+
borderColor: sharedTokens.stroke.accentBlue
|
|
333
|
+
},
|
|
334
|
+
accentGreen: {
|
|
335
|
+
borderColor: sharedTokens.stroke.accentGreen
|
|
336
|
+
},
|
|
337
|
+
accentGrey: {
|
|
338
|
+
borderColor: sharedTokens.stroke.accentGrey
|
|
339
|
+
},
|
|
340
|
+
accentHoney: {
|
|
341
|
+
borderColor: sharedTokens.stroke.accentHoney
|
|
342
|
+
},
|
|
343
|
+
accentOrange: {
|
|
344
|
+
borderColor: sharedTokens.stroke.accentOrange
|
|
345
|
+
},
|
|
346
|
+
accentPlum: {
|
|
347
|
+
borderColor: sharedTokens.stroke.accentPlum
|
|
348
|
+
},
|
|
349
|
+
accentRed: {
|
|
350
|
+
borderColor: sharedTokens.stroke.accentRed
|
|
351
|
+
},
|
|
352
|
+
accentSea: {
|
|
353
|
+
borderColor: sharedTokens.stroke.accentSea
|
|
354
|
+
},
|
|
355
|
+
accentSky: {
|
|
356
|
+
borderColor: sharedTokens.stroke.accentSky
|
|
357
|
+
},
|
|
358
|
+
accentStone: {
|
|
359
|
+
borderColor: sharedTokens.stroke.accentStone
|
|
360
|
+
},
|
|
361
|
+
accentViolet: {
|
|
362
|
+
borderColor: sharedTokens.stroke.accentViolet
|
|
296
363
|
}
|
|
297
364
|
};
|
|
298
365
|
const backgroundColorVariants = {
|
|
@@ -353,6 +420,7 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
353
420
|
}
|
|
354
421
|
};
|
|
355
422
|
const shadowVariants = {
|
|
423
|
+
//legacy
|
|
356
424
|
topmost: {
|
|
357
425
|
boxShadow: boxShadowObjectsToCSSString(sharedTokens.boxShadow.elevation4)
|
|
358
426
|
},
|
|
@@ -362,7 +430,20 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
362
430
|
above: {
|
|
363
431
|
boxShadow: boxShadowObjectsToCSSString(sharedTokens.boxShadow.elevation2)
|
|
364
432
|
},
|
|
365
|
-
none: {}
|
|
433
|
+
none: {},
|
|
434
|
+
//new
|
|
435
|
+
elevation1: {
|
|
436
|
+
boxShadow: boxShadowObjectsToCSSString(sharedTokens.boxShadow.elevation1)
|
|
437
|
+
},
|
|
438
|
+
elevation2: {
|
|
439
|
+
boxShadow: boxShadowObjectsToCSSString(sharedTokens.boxShadow.elevation2)
|
|
440
|
+
},
|
|
441
|
+
elevation3: {
|
|
442
|
+
boxShadow: boxShadowObjectsToCSSString(sharedTokens.boxShadow.elevation3)
|
|
443
|
+
},
|
|
444
|
+
elevation4: {
|
|
445
|
+
boxShadow: boxShadowObjectsToCSSString(sharedTokens.boxShadow.elevation4)
|
|
446
|
+
}
|
|
366
447
|
};
|
|
367
448
|
const {
|
|
368
449
|
focusColor,
|
package/lib/View/v2/styles.js
CHANGED
|
@@ -44,10 +44,25 @@ const processBorderRadiusValue = (value, sharedTokens) => {
|
|
|
44
44
|
if (v === 'circle') return '100%';
|
|
45
45
|
if (v === 'pill') return '999em';
|
|
46
46
|
|
|
47
|
+
// Handle legacy values
|
|
48
|
+
if (v === 'small') return sharedTokens.legacy.radiusSmall;
|
|
49
|
+
if (v === 'medium') return sharedTokens.legacy.radiusMedium;
|
|
50
|
+
if (v === 'large') return sharedTokens.legacy.radiusLarge;
|
|
51
|
+
|
|
47
52
|
// Handle SharedTokens values
|
|
48
|
-
if (v === '
|
|
49
|
-
if (v === '
|
|
50
|
-
if (v === '
|
|
53
|
+
if (v === 'xxl') return sharedTokens.borderRadius.xxl;
|
|
54
|
+
if (v === 'xl') return sharedTokens.borderRadius.xl;
|
|
55
|
+
if (v === 'lg') return sharedTokens.borderRadius.lg;
|
|
56
|
+
if (v === 'md') return sharedTokens.borderRadius.md;
|
|
57
|
+
if (v === 'sm') return sharedTokens.borderRadius.sm;
|
|
58
|
+
if (v === 'xs') return sharedTokens.borderRadius.xs;
|
|
59
|
+
if (v === 'full') return sharedTokens.borderRadius.full;
|
|
60
|
+
if (v === 'card.nestedContainer.sm') return sharedTokens.borderRadius.card.nestedContainer.sm;
|
|
61
|
+
if (v === 'card.nestedContainer.md') return sharedTokens.borderRadius.card.nestedContainer.md;
|
|
62
|
+
if (v === 'card.nestedContainer.lg') return sharedTokens.borderRadius.card.nestedContainer.lg;
|
|
63
|
+
if (v === 'card.sm') return sharedTokens.borderRadius.card.sm;
|
|
64
|
+
if (v === 'card.md') return sharedTokens.borderRadius.card.md;
|
|
65
|
+
if (v === 'card.lg') return sharedTokens.borderRadius.card.lg;
|
|
51
66
|
|
|
52
67
|
// Pass through CSS values (1rem, 12px, etc.)
|
|
53
68
|
return v;
|
|
@@ -64,11 +79,16 @@ const processBorderWidthValue = (value, sharedTokens) => {
|
|
|
64
79
|
if (v === 'auto' || v === '0') return v;
|
|
65
80
|
if (v === 'none') return '0';
|
|
66
81
|
|
|
67
|
-
// Handle
|
|
82
|
+
// Handle legacy values
|
|
68
83
|
if (v === 'small') return sharedTokens.strokeWidth.sm;
|
|
69
84
|
if (v === 'medium') return sharedTokens.strokeWidth.md;
|
|
70
85
|
if (v === 'large') return sharedTokens.strokeWidth.lg;
|
|
71
86
|
|
|
87
|
+
// Handle SharedTokens values
|
|
88
|
+
if (v === 'sm') return sharedTokens.strokeWidth.sm;
|
|
89
|
+
if (v === 'md') return sharedTokens.strokeWidth.md;
|
|
90
|
+
if (v === 'lg') return sharedTokens.strokeWidth.lg;
|
|
91
|
+
|
|
72
92
|
// Pass through CSS values (1rem, 2px, etc.)
|
|
73
93
|
return v;
|
|
74
94
|
});
|
|
@@ -273,6 +293,7 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
273
293
|
}
|
|
274
294
|
};
|
|
275
295
|
const borderColorVariants = {
|
|
296
|
+
//legacy colors
|
|
276
297
|
transparent: {
|
|
277
298
|
borderColor: componentTheme.borderColorTransparent
|
|
278
299
|
},
|
|
@@ -299,6 +320,52 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
299
320
|
},
|
|
300
321
|
danger: {
|
|
301
322
|
borderColor: componentTheme.borderColorDanger
|
|
323
|
+
},
|
|
324
|
+
//new colors
|
|
325
|
+
strongColor: {
|
|
326
|
+
borderColor: sharedTokens.stroke.strongColor
|
|
327
|
+
},
|
|
328
|
+
visualSeparator: {
|
|
329
|
+
borderColor: sharedTokens.stroke.visualSeparator
|
|
330
|
+
},
|
|
331
|
+
accentAsh: {
|
|
332
|
+
borderColor: sharedTokens.stroke.accentAsh
|
|
333
|
+
},
|
|
334
|
+
accentAurora: {
|
|
335
|
+
borderColor: sharedTokens.stroke.accentAurora
|
|
336
|
+
},
|
|
337
|
+
accentBlue: {
|
|
338
|
+
borderColor: sharedTokens.stroke.accentBlue
|
|
339
|
+
},
|
|
340
|
+
accentGreen: {
|
|
341
|
+
borderColor: sharedTokens.stroke.accentGreen
|
|
342
|
+
},
|
|
343
|
+
accentGrey: {
|
|
344
|
+
borderColor: sharedTokens.stroke.accentGrey
|
|
345
|
+
},
|
|
346
|
+
accentHoney: {
|
|
347
|
+
borderColor: sharedTokens.stroke.accentHoney
|
|
348
|
+
},
|
|
349
|
+
accentOrange: {
|
|
350
|
+
borderColor: sharedTokens.stroke.accentOrange
|
|
351
|
+
},
|
|
352
|
+
accentPlum: {
|
|
353
|
+
borderColor: sharedTokens.stroke.accentPlum
|
|
354
|
+
},
|
|
355
|
+
accentRed: {
|
|
356
|
+
borderColor: sharedTokens.stroke.accentRed
|
|
357
|
+
},
|
|
358
|
+
accentSea: {
|
|
359
|
+
borderColor: sharedTokens.stroke.accentSea
|
|
360
|
+
},
|
|
361
|
+
accentSky: {
|
|
362
|
+
borderColor: sharedTokens.stroke.accentSky
|
|
363
|
+
},
|
|
364
|
+
accentStone: {
|
|
365
|
+
borderColor: sharedTokens.stroke.accentStone
|
|
366
|
+
},
|
|
367
|
+
accentViolet: {
|
|
368
|
+
borderColor: sharedTokens.stroke.accentViolet
|
|
302
369
|
}
|
|
303
370
|
};
|
|
304
371
|
const backgroundColorVariants = {
|
|
@@ -359,6 +426,7 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
359
426
|
}
|
|
360
427
|
};
|
|
361
428
|
const shadowVariants = {
|
|
429
|
+
//legacy
|
|
362
430
|
topmost: {
|
|
363
431
|
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(sharedTokens.boxShadow.elevation4)
|
|
364
432
|
},
|
|
@@ -368,7 +436,20 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
368
436
|
above: {
|
|
369
437
|
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(sharedTokens.boxShadow.elevation2)
|
|
370
438
|
},
|
|
371
|
-
none: {}
|
|
439
|
+
none: {},
|
|
440
|
+
//new
|
|
441
|
+
elevation1: {
|
|
442
|
+
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(sharedTokens.boxShadow.elevation1)
|
|
443
|
+
},
|
|
444
|
+
elevation2: {
|
|
445
|
+
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(sharedTokens.boxShadow.elevation2)
|
|
446
|
+
},
|
|
447
|
+
elevation3: {
|
|
448
|
+
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(sharedTokens.boxShadow.elevation3)
|
|
449
|
+
},
|
|
450
|
+
elevation4: {
|
|
451
|
+
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(sharedTokens.boxShadow.elevation4)
|
|
452
|
+
}
|
|
372
453
|
};
|
|
373
454
|
const {
|
|
374
455
|
focusColor,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-view",
|
|
3
|
-
"version": "11.7.4-snapshot-
|
|
3
|
+
"version": "11.7.4-snapshot-108",
|
|
4
4
|
"description": "A component for basic styles including spacing, sizing, borders, display, positioning, and focus states.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
|
-
"@instructure/
|
|
19
|
-
"@instructure/
|
|
20
|
-
"@instructure/shared-types": "11.7.4-snapshot-
|
|
21
|
-
"@instructure/ui-
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-
|
|
18
|
+
"@instructure/emotion": "11.7.4-snapshot-108",
|
|
19
|
+
"@instructure/console": "11.7.4-snapshot-108",
|
|
20
|
+
"@instructure/shared-types": "11.7.4-snapshot-108",
|
|
21
|
+
"@instructure/ui-color-utils": "11.7.4-snapshot-108",
|
|
22
|
+
"@instructure/ui-dom-utils": "11.7.4-snapshot-108",
|
|
23
|
+
"@instructure/ui-position": "11.7.4-snapshot-108",
|
|
24
|
+
"@instructure/ui-i18n": "11.7.4-snapshot-108",
|
|
25
|
+
"@instructure/ui-react-utils": "11.7.4-snapshot-108",
|
|
26
|
+
"@instructure/ui-themes": "11.7.4-snapshot-108"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@testing-library/jest-dom": "^6.9.1",
|
|
30
30
|
"@testing-library/react": "16.3.2",
|
|
31
31
|
"vitest": "^4.1.9",
|
|
32
|
-
"@instructure/ui-axe-check": "11.7.4-snapshot-
|
|
33
|
-
"@instructure/ui-babel-preset": "11.7.4-snapshot-
|
|
32
|
+
"@instructure/ui-axe-check": "11.7.4-snapshot-108",
|
|
33
|
+
"@instructure/ui-babel-preset": "11.7.4-snapshot-108"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=18 <=19"
|
|
@@ -30,7 +30,6 @@ import type {
|
|
|
30
30
|
} from '@instructure/shared-types'
|
|
31
31
|
import type { PlacementPropValues } from '@instructure/ui-position'
|
|
32
32
|
import type {
|
|
33
|
-
Shadow,
|
|
34
33
|
Spacing,
|
|
35
34
|
Stacking,
|
|
36
35
|
WithStyleProps,
|
|
@@ -52,7 +51,7 @@ type ContextViewOwnProps = {
|
|
|
52
51
|
debug?: boolean
|
|
53
52
|
margin?: Spacing
|
|
54
53
|
padding?: Spacing
|
|
55
|
-
shadow?:
|
|
54
|
+
shadow?: 'resting' | 'above' | 'topmost' | 'none'
|
|
56
55
|
stacking?: Stacking
|
|
57
56
|
placement?: PlacementPropValues
|
|
58
57
|
borderColor?: string
|
package/src/View/v1/props.ts
CHANGED
|
@@ -33,8 +33,6 @@ import type {
|
|
|
33
33
|
WithStyleProps,
|
|
34
34
|
Spacing,
|
|
35
35
|
BorderWidth,
|
|
36
|
-
BorderRadii,
|
|
37
|
-
Shadow,
|
|
38
36
|
Stacking,
|
|
39
37
|
ComponentStyle,
|
|
40
38
|
StyleObject
|
|
@@ -182,11 +180,11 @@ type ViewOwnProps = {
|
|
|
182
180
|
* assigned to individual corners in CSS shorthand style (e.g., `"medium large none pill"`).
|
|
183
181
|
* Also accepts valid CSS length values like `1rem` or `12px`
|
|
184
182
|
*/
|
|
185
|
-
borderRadius?:
|
|
183
|
+
borderRadius?: string
|
|
186
184
|
/**
|
|
187
185
|
* Controls the shadow depth for the `<View />`
|
|
188
186
|
*/
|
|
189
|
-
shadow?:
|
|
187
|
+
shadow?: 'resting' | 'above' | 'topmost' | 'none'
|
|
190
188
|
|
|
191
189
|
/**
|
|
192
190
|
* Controls the z-index depth for the `<View />`
|