@rolemodel/optics 2.0.0 → 2.1.0

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,5 +1,6 @@
1
+
1
2
  @import 'https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wdth,wght@0,62.5..100,100..900;1,62.5..100,100..900&family=Noto+Serif:ital,wdth,wght@0,62.5..100,100..900;1,62.5..100,100..900&display=swap';
2
- @import 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block';
3
+ @import 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght@100..700&display=block';
3
4
  /* Third party Vendors */
4
5
  /* Box sizing rules */
5
6
  *,
@@ -66,7 +67,12 @@ select {
66
67
  scroll-behavior: auto !important;
67
68
  }
68
69
  }
69
- /* Tokens */
70
+ /* Fonts */
71
+ /*
72
+ Instead of hosting the font files locally which requires a compiler to handle them, we pull fonts
73
+ from Google's CDN. For more information on the variable font, see:
74
+ https://developers.google.com/fonts/docs/material_symbols#variable_font_with_google_fonts
75
+ */
70
76
  /*
71
77
  Noto Sans supports:
72
78
  font-weight: {anything between 100 and 900}
@@ -79,6 +85,14 @@ Noto Sans supports:
79
85
  font-stretch: {anything between 62.5% and 100%}
80
86
  font-style: {normal or italic}
81
87
  */
88
+ /* Noto Sans and Noto Serif */
89
+ /*
90
+ See all icons at: https://fonts.google.com/icons?icon.set=Material+Symbols
91
+ This import of Material Symbols supports:
92
+ font weight set through: font-variation-settings: 'wght' {100..700}
93
+ */
94
+ /* Material Symbols */
95
+ /* Tokens */
82
96
  :root {
83
97
  /* Color HSLs
84
98
  A theme comprised of a primary, neutral, warning, danger, info, and notice colors.
@@ -281,6 +295,7 @@ Noto Sans supports:
281
295
  * @tokens Transition
282
296
  */
283
297
  --op-transition-accordion: rotate 120ms ease-in;
298
+ --op-transition-accordion-content: height 300ms ease, content-visibility 300ms ease allow-discrete;
284
299
  --op-transition-input: all 120ms ease-in;
285
300
  --op-transition-sidebar: all 200ms ease-in-out;
286
301
  --op-transition-modal: all 300ms ease-in;
@@ -2358,6 +2373,11 @@ small {
2358
2373
  /* Public API (customizable component options) */
2359
2374
  --_op-accordion-summary-min-height: calc(8 * var(--op-size-unit)); /* 32px */
2360
2375
 
2376
+ overflow: hidden;
2377
+ interpolate-size: allow-keywords;
2378
+
2379
+ /* Elements */
2380
+
2361
2381
  summary {
2362
2382
  display: grid;
2363
2383
  min-height: var(--_op-accordion-summary-min-height);
@@ -2379,19 +2399,40 @@ small {
2379
2399
  }
2380
2400
 
2381
2401
  .accordion__marker {
2382
- --op-mso-optical-sizing: 48;
2402
+ --__op-icon-font-size: var(--_op-icon-font-size-x-large);
2403
+ --__op-icon-optical-size: var(--_op-icon-optical-size-x-large);
2383
2404
 
2384
- font-size: var(--op-font-x-large);
2385
2405
  justify-self: flex-end;
2386
2406
  transition: var(--op-transition-accordion);
2387
2407
  user-select: none;
2388
2408
  }
2389
2409
  }
2390
2410
 
2411
+ &::details-content {
2412
+ height: 0;
2413
+ transition: var(--op-transition-accordion-content);
2414
+ }
2415
+
2391
2416
  &[open] {
2392
2417
  summary .accordion__marker {
2393
2418
  rotate: 0.25turn;
2394
2419
  }
2420
+
2421
+ &::details-content {
2422
+ height: auto;
2423
+ }
2424
+ }
2425
+
2426
+ /* Modifiers */
2427
+
2428
+ &.accordion--disable-animation {
2429
+ summary .accordion__marker {
2430
+ transition: none;
2431
+ }
2432
+
2433
+ &::details-content {
2434
+ transition: none;
2435
+ }
2395
2436
  }
2396
2437
  }
2397
2438
  .alert {
@@ -2404,10 +2445,10 @@ small {
2404
2445
  /* Elements */
2405
2446
 
2406
2447
  .alert__icon {
2407
- --op-mso-optical-sizing: 40; /* .icon--large styling */
2408
- --op-mso-weight: var(--op-font-weight-bold); /* .icon--weight-bold styling */
2448
+ --__op-icon-font-size: var(--_op-icon-font-size-large);
2449
+ --__op-icon-optical-size: var(--_op-icon-optical-size-large);
2450
+ --__op-icon-weight: var(--_op-icon-weight-bold);
2409
2451
 
2410
- font-size: var(--op-font-large); /* .icon--large styling */
2411
2452
  line-height: var(--op-line-height-dense);
2412
2453
  }
2413
2454
 
@@ -3631,101 +3672,124 @@ textarea.form-control:not([type='radio'], [type='checkbox']) {
3631
3672
  }
3632
3673
  /* stylelint-enable no-descending-specificity */
3633
3674
  }
3634
- /*
3635
- Look up icons at: https://fonts.google.com/icons?icon.set=Material+Symbols
3636
- Instead of hosting the font files locally which requires the compiler to handle them, we pull the icons
3637
- from Googles CDN like we do for our other fonts
3638
- https://developers.google.com/fonts/docs/material_symbols#variable_font_with_google_fonts
3639
- */
3640
- .material-symbols-outlined,
3641
- .material-symbols {
3642
- --op-mso-fill: 0;
3643
- --op-mso-weight: var(--op-font-weight-normal);
3644
- --op-mso-grade: 0;
3645
- --op-mso-optical-sizing: 20;
3675
+ .icon {
3676
+ /* Public API (customizable component options) */
3646
3677
 
3647
- font-size: var(--op-font-medium);
3648
- font-variation-settings:
3649
- 'FILL' var(--op-mso-fill),
3650
- 'wght' var(--op-mso-weight),
3651
- 'GRAD' var(--op-mso-grade),
3652
- 'opsz' var(--op-mso-optical-sizing);
3678
+ /* Weight */
3679
+ --_op-icon-weight-light: var(--op-font-weight-light);
3680
+ --_op-icon-weight-normal: var(--op-font-weight-normal);
3681
+ --_op-icon-weight-semi-bold: var(--op-font-weight-semi-bold);
3682
+ --_op-icon-weight-bold: var(--op-font-weight-bold);
3683
+
3684
+ /* Fill */
3685
+ --_op-icon-fill-outlined: 0;
3686
+ --_op-icon-fill-filled: 1;
3687
+
3688
+ /* Emphasis */
3689
+ --_op-icon-emphasis-low: -20;
3690
+ --_op-icon-emphasis-normal: 0;
3691
+ --_op-icon-emphasis-high: 200;
3692
+
3693
+ /* Size */
3694
+ --_op-icon-font-size-small: var(--op-font-small);
3695
+ --_op-icon-font-size-medium: var(--op-font-medium);
3696
+ --_op-icon-font-size-large: var(--op-font-large);
3697
+ --_op-icon-font-size-x-large: var(--op-font-2x-large);
3698
+ --_op-icon-optical-size-small: 20;
3699
+ --_op-icon-optical-size-medium: 20;
3700
+ --_op-icon-optical-size-large: 40;
3701
+ --_op-icon-optical-size-x-large: 48;
3702
+
3703
+ /* Private API (component option defaults) */
3704
+ --__op-icon-weight: var(--_op-icon-weight-normal);
3705
+ --__op-icon-fill: var(--_op-icon-fill-outlined);
3706
+ --__op-icon-emphasis: var(--_op-icon-emphasis-normal);
3707
+ --__op-icon-font-size: var(--_op-icon-font-size-medium);
3708
+ --__op-icon-optical-size: var(--_op-icon-optical-size-medium);
3709
+
3710
+ display: inline-block;
3711
+ width: var(--__op-icon-font-size);
3712
+ height: var(--__op-icon-font-size);
3713
+ font-size: var(--__op-icon-font-size);
3714
+ font-weight: var(--__op-icon-weight);
3653
3715
  line-height: var(--op-line-height-densest);
3654
3716
  vertical-align: middle;
3655
- }
3656
- /* Fill */
3657
- .icon--outlined {
3658
- --op-mso-fill: 0;
3659
- }
3660
- .icon--filled {
3661
- --op-mso-fill: 1;
3662
- }
3663
- /* Weight */
3664
- .icon--weight-light {
3665
- --op-mso-weight: var(--op-font-weight-light);
3666
- }
3667
- .icon--weight-normal {
3668
- --op-mso-weight: var(--op-font-weight-normal);
3669
- }
3670
- .icon--weight-semi-bold {
3671
- --op-mso-weight: var(--op-font-weight-semi-bold);
3672
- }
3673
- .icon--weight-bold {
3674
- --op-mso-weight: var(--op-font-weight-bold);
3675
- }
3676
- /* Emphasis */
3677
- .icon--low-emphasis {
3678
- --op-mso-grade: -20;
3679
- }
3680
- .icon--normal-emphasis {
3681
- --op-mso-grade: 0;
3682
- }
3683
- .icon--high-emphasis {
3684
- --op-mso-grade: 200;
3685
- }
3686
- /* Size */
3687
- .icon--medium {
3688
- font-size: var(--op-font-medium);
3689
3717
 
3690
- --op-mso-optical-sizing: 20;
3691
- }
3692
- .icon--large {
3693
- font-size: var(--op-font-large);
3718
+ /* Fill Modifiers */
3719
+ &.icon--outlined {
3720
+ --__op-icon-fill: var(--_op-icon-fill-outlined);
3721
+ }
3694
3722
 
3695
- --op-mso-optical-sizing: 40;
3696
- }
3697
- .icon--x-large {
3698
- font-size: var(--op-font-2x-large);
3723
+ &.icon--filled {
3724
+ --__op-icon-fill: var(--_op-icon-fill-filled);
3725
+ }
3699
3726
 
3700
- --op-mso-optical-sizing: 48;
3701
- }
3702
- .custom-icons {
3703
- display: inline-block;
3704
- width: var(--op-font-2x-large);
3705
- height: var(--op-font-2x-large);
3727
+ /* Weight Modifiers */
3728
+ &.icon--weight-light {
3729
+ --__op-icon-weight: var(--_op-icon-weight-light);
3730
+ }
3706
3731
 
3707
- &.icon--medium {
3708
- font-size: var(--op-font-small);
3732
+ &.icon--weight-normal {
3733
+ --__op-icon-weight: var(--_op-icon-weight-normal);
3734
+ }
3735
+
3736
+ &.icon--weight-semi-bold {
3737
+ --__op-icon-weight: var(--_op-icon-weight-semi-bold);
3738
+ }
3739
+
3740
+ &.icon--weight-bold {
3741
+ --__op-icon-weight: var(--_op-icon-weight-bold);
3742
+ }
3743
+
3744
+ /* Emphasis */
3745
+ &.icon--low-emphasis {
3746
+ --__op-icon-emphasis: var(--_op-icon-emphasis-low);
3747
+ }
3748
+
3749
+ &.icon--normal-emphasis {
3750
+ --__op-icon-emphasis: var(--_op-icon-emphasis-normal);
3751
+ }
3752
+
3753
+ &.icon--high-emphasis {
3754
+ --__op-icon-emphasis: var(--_op-icon-emphasis-high);
3755
+ }
3756
+
3757
+ /* Size Modifiers */
3758
+ &.icon--small {
3759
+ --__op-icon-font-size: var(--_op-icon-font-size-small);
3760
+ --__op-icon-optical-size: var(--_op-icon-optical-size-small);
3761
+ }
3709
3762
 
3710
- --op-mso-optical-sizing: 20;
3763
+ &.icon--medium {
3764
+ --__op-icon-font-size: var(--_op-icon-font-size-medium);
3765
+ --__op-icon-optical-size: var(--_op-icon-optical-size-medium);
3711
3766
  }
3712
3767
 
3713
3768
  &.icon--large {
3714
- width: var(--op-font-large);
3715
- height: var(--op-font-large);
3769
+ --__op-icon-font-size: var(--_op-icon-font-size-large);
3770
+ --__op-icon-optical-size: var(--_op-icon-optical-size-large);
3716
3771
  }
3717
3772
 
3718
3773
  &.icon--x-large {
3719
- width: var(--op-font-3x-large);
3720
- height: var(--op-font-3x-large);
3774
+ --__op-icon-font-size: var(--_op-icon-font-size-x-large);
3775
+ --__op-icon-optical-size: var(--_op-icon-optical-size-x-large);
3721
3776
  }
3722
3777
  }
3723
- .custom-icons svg {
3724
- width: 100%;
3725
- height: 100%;
3778
+ /* Material Icons class provided by the Google Fonts CDN */
3779
+ .material-symbols-outlined {
3780
+ font-variation-settings:
3781
+ 'FILL' var(--__op-icon-fill),
3782
+ 'wght' var(--__op-icon-weight),
3783
+ 'GRAD' var(--__op-icon-emphasis),
3784
+ 'opsz' var(--__op-icon-optical-size);
3785
+ font-weight: unset;
3726
3786
  }
3727
- .icon-link {
3728
- line-height: 0;
3787
+ /* Custom SVG Icons app specific */
3788
+ .custom-icons {
3789
+ svg {
3790
+ width: 100%;
3791
+ height: 100%;
3792
+ }
3729
3793
  }
3730
3794
  .modal-wrapper {
3731
3795
  /* Public API (customizable component options) */
@@ -4016,10 +4080,9 @@ dialog.modal {
4016
4080
  justify-content: flex-start;
4017
4081
 
4018
4082
  .material-symbols-outlined {
4019
- --op-mso-optical-sizing: 40;
4020
- --op-mso-weight: var(--op-font-weight-bold);
4021
-
4022
- font-size: var(--op-font-large);
4083
+ --__op-icon-font-size: var(--_op-icon-font-size-large);
4084
+ --__op-icon-optical-size: var(--_op-icon-optical-size-large);
4085
+ --__op-icon-weight: var(--_op-icon-weight-bold);
4023
4086
  }
4024
4087
  }
4025
4088
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolemodel/optics",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "packageManager": "yarn@4.2.2",
5
5
  "description": "Optics is a css package that provides base styles and components that can be integrated and customized in a variety of projects.",
6
6
  "main": "dist/css/optics.css",
@@ -46,33 +46,33 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@babel/preset-env": "^7.23.9",
49
- "@storybook/addon-essentials": "^8.1.3",
50
- "@storybook/blocks": "^8.1.3",
51
- "@storybook/html": "^8.1.3",
52
- "@storybook/html-vite": "^8.1.3",
53
- "@storybook/manager-api": "^8.1.3",
54
- "@storybook/preview-api": "^8.1.3",
55
- "@storybook/test": "^8.1.3",
56
- "@storybook/theming": "^8.1.3",
49
+ "@storybook/addon-essentials": "^8.5.3",
50
+ "@storybook/blocks": "^8.5.3",
51
+ "@storybook/html": "^8.5.3",
52
+ "@storybook/html-vite": "^8.5.3",
53
+ "@storybook/manager-api": "^8.5.3",
54
+ "@storybook/preview-api": "^8.5.3",
55
+ "@storybook/test": "^8.5.3",
56
+ "@storybook/theming": "^8.5.3",
57
57
  "eslint": "^8.45.0",
58
58
  "eslint-config-prettier": "^9.1.0",
59
59
  "eslint-config-standard": "^17.1.0",
60
60
  "eslint-plugin-import": "^2.27.5",
61
61
  "eslint-plugin-n": "^16.0.1",
62
62
  "eslint-plugin-promise": "^6.1.1",
63
- "eslint-plugin-storybook": "^0.6.13",
63
+ "eslint-plugin-storybook": "^0.11.2",
64
64
  "generate-template-files": "^3.2.1",
65
65
  "postcss": "^8.4.38",
66
66
  "postcss-cli": "^11.0.0",
67
67
  "postcss-import": "^16.1.0",
68
68
  "prettier": "^3.0.0",
69
- "storybook": "^8.1.3",
69
+ "storybook": "^8.5.3",
70
70
  "storybook-design-token": "^3.1.0",
71
71
  "style-loader": "^3.3.3",
72
72
  "stylelint": "^16.2.1",
73
73
  "stylelint-config-idiomatic-order": "^10.0.0",
74
74
  "stylelint-prettier": "^5.0.0",
75
- "vite": "^5.2.11"
75
+ "vite": "^5.4.14"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "tom-select": "^2.0.0"