@stratakit/mui 0.4.1 → 0.5.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/DEV/Root.js +43 -21
  3. package/dist/DEV/styles.css.js +1 -1
  4. package/dist/DEV/~components/MuiAccordion.js +36 -0
  5. package/dist/DEV/~components/MuiAlert.js +37 -0
  6. package/dist/DEV/~components/MuiAutocomplete.js +134 -11
  7. package/dist/DEV/~components/MuiBadge.js +22 -4
  8. package/dist/DEV/~components/MuiCard.js +52 -8
  9. package/dist/DEV/~components/MuiDivider.js +2 -1
  10. package/dist/DEV/~components/MuiMenu.js +22 -0
  11. package/dist/DEV/~components/MuiPopover.js +40 -0
  12. package/dist/DEV/~components/MuiTabs.js +43 -0
  13. package/dist/DEV/~components/MuiTypography.js +16 -13
  14. package/dist/DEV/~createTheme.js +146 -53
  15. package/dist/Root.internal.d.ts +1 -1
  16. package/dist/Root.js +13 -4
  17. package/dist/styles.css.js +1 -1
  18. package/dist/types.d.ts +137 -5
  19. package/dist/~components/MuiAccordion.d.ts +11 -0
  20. package/dist/~components/MuiAccordion.js +30 -0
  21. package/dist/~components/MuiAlert.d.ts +4 -0
  22. package/dist/~components/MuiAlert.js +38 -0
  23. package/dist/~components/MuiAutocomplete.d.ts +4 -1
  24. package/dist/~components/MuiAutocomplete.js +132 -12
  25. package/dist/~components/MuiBadge.d.ts +5 -3
  26. package/dist/~components/MuiBadge.js +22 -4
  27. package/dist/~components/MuiCard.d.ts +2 -1
  28. package/dist/~components/MuiCard.js +66 -11
  29. package/dist/~components/MuiChip.d.ts +1 -1
  30. package/dist/~components/MuiDivider.js +1 -1
  31. package/dist/~components/MuiMenu.d.ts +7 -0
  32. package/dist/~components/MuiMenu.js +25 -0
  33. package/dist/~components/MuiPopover.d.ts +10 -0
  34. package/dist/~components/MuiPopover.js +62 -0
  35. package/dist/~components/MuiTabs.d.ts +8 -0
  36. package/dist/~components/MuiTabs.js +33 -0
  37. package/dist/~components/MuiTypography.d.ts +17 -1
  38. package/dist/~components/MuiTypography.js +13 -12
  39. package/dist/~createTheme.d.ts +4 -1
  40. package/dist/~createTheme.js +153 -70
  41. package/package.json +9 -9
@@ -5,23 +5,31 @@ import OutlinedInput from "@mui/material/OutlinedInput";
5
5
  import StepConnector from "@mui/material/StepConnector";
6
6
  import { createTheme as createMuiTheme } from "@mui/material/styles";
7
7
  import cx from "classnames";
8
- import { MuiAutocomplete } from "./~components/MuiAutocomplete.js";
8
+ import { MuiAccordionRootSlot, MuiAccordionSummary } from "./~components/MuiAccordion.js";
9
+ import { MuiAlert, MuiAlertTitle } from "./~components/MuiAlert.js";
10
+ import { MuiAutocomplete, MuiAutocompleteChip, MuiAutocompleteChipDeleteIcon, MuiAutocompleteClearIndicator } from "./~components/MuiAutocomplete.js";
9
11
  import { MuiAvatarGroup } from "./~components/MuiAvatarGroup.js";
10
- import { MuiBadge } from "./~components/MuiBadge.js";
12
+ import { MuiBadge, MuiBadgeBadge } from "./~components/MuiBadge.js";
11
13
  import { MuiBottomNavigationAction } from "./~components/MuiBottomNavigation.js";
12
14
  import { MuiButtonBase } from "./~components/MuiButtonBase.js";
13
- import { MuiCard, MuiCardActionArea, MuiCardMedia } from "./~components/MuiCard.js";
15
+ import { MuiCard, MuiCardActionArea, MuiCardHeaderTitle, MuiCardMedia } from "./~components/MuiCard.js";
14
16
  import { MuiChip, MuiChipDeleteIcon, MuiChipLabel } from "./~components/MuiChip.js";
15
17
  import { MuiDivider } from "./~components/MuiDivider.js";
16
18
  import { MuiIconButton } from "./~components/MuiIconButton.js";
17
19
  import { MuiInputLabel } from "./~components/MuiInputLabel.js";
20
+ import { MuiMenuListSlot } from "./~components/MuiMenu.js";
21
+ import { MuiPopoverPaperSlot } from "./~components/MuiPopover.js";
18
22
  import { MuiSnackbar } from "./~components/MuiSnackbar.js";
19
23
  import { MuiStepIcon } from "./~components/MuiStepper.js";
20
24
  import { MuiTableBody, MuiTableCell, MuiTableHead } from "./~components/MuiTable.js";
25
+ import { MuiTab, MuiTabs } from "./~components/MuiTabs.js";
21
26
  import { MuiToggleButton } from "./~components/MuiToggleButton.js";
22
- import { MuiTypography } from "./~components/MuiTypography.js";
27
+ import { MuiTypography, variantMapping } from "./~components/MuiTypography.js";
23
28
  import { ArrowDownIcon, CaretsUpDownIcon, ChevronDownIcon, ChevronLeftDoubleIcon, ChevronLeftIcon, ChevronRightDoubleIcon, ChevronRightIcon, DismissIcon, ErrorIcon, InfoIcon, SuccessIcon, WarningIcon } from "./Icon.js";
24
- function createTheme() {
29
+ function createTheme(args) {
30
+ const {
31
+ portalContainer: container
32
+ } = args;
25
33
  const palette = {
26
34
  primary: {
27
35
  main: "var(--stratakit-mui-palette-primary-main)"
@@ -72,31 +80,35 @@ function createTheme() {
72
80
  fontSize: 14
73
81
  },
74
82
  h1: {
75
- fontSize: 48
83
+ fontSize: 20
76
84
  },
77
85
  h2: {
78
- fontSize: 40
86
+ fontSize: 18
79
87
  },
80
88
  h3: {
81
- fontSize: 32
89
+ fontSize: 16
82
90
  },
83
91
  h4: {
84
- fontSize: 28
92
+ fontSize: 14
85
93
  },
86
94
  h5: {
87
- fontSize: 24
95
+ fontSize: 12
88
96
  },
89
97
  h6: {
90
- fontSize: 20
98
+ fontSize: 12
91
99
  },
92
100
  caption: {
93
101
  fontSize: 12
94
102
  },
103
+ overline: {
104
+ fontSize: 12,
105
+ textTransform: "none"
106
+ },
95
107
  subtitle1: {
96
- fontSize: 12
108
+ fontSize: 16
97
109
  },
98
110
  subtitle2: {
99
- fontSize: 11
111
+ fontSize: 14
100
112
  }
101
113
  },
102
114
  shadows: [
@@ -123,6 +135,10 @@ function createTheme() {
123
135
  MuiAccordion: {
124
136
  defaultProps: {
125
137
  component: Role.div,
138
+ disableGutters: true,
139
+ slots: {
140
+ root: MuiAccordionRootSlot
141
+ },
126
142
  slotProps: {
127
143
  region: {
128
144
  role: void 0,
@@ -133,26 +149,33 @@ function createTheme() {
133
149
  },
134
150
  MuiAccordionSummary: {
135
151
  defaultProps: {
136
- component: Role.div,
152
+ component: MuiAccordionSummary,
137
153
  nativeButton: false,
138
154
  expandIcon: /* @__PURE__ */ jsx(ChevronDownIcon, {})
139
155
  }
140
156
  },
141
157
  MuiAlert: {
142
158
  defaultProps: {
143
- component: Role.div,
159
+ component: MuiAlert,
144
160
  variant: "outlined",
161
+ severity: "none",
145
162
  iconMapping: {
146
163
  error: /* @__PURE__ */ jsx(ErrorIcon, {}),
147
164
  info: /* @__PURE__ */ jsx(InfoIcon, {}),
148
165
  success: /* @__PURE__ */ jsx(SuccessIcon, {}),
149
166
  warning: /* @__PURE__ */ jsx(WarningIcon, {})
167
+ },
168
+ slotProps: {
169
+ root: {
170
+ role: "group"
171
+ // Overriding role="alert".
172
+ }
150
173
  }
151
174
  }
152
175
  },
153
176
  MuiAlertTitle: {
154
177
  defaultProps: {
155
- component: Role.div
178
+ component: MuiAlertTitle
156
179
  }
157
180
  },
158
181
  MuiAutocomplete: {
@@ -165,6 +188,7 @@ function createTheme() {
165
188
  }, option, _, ownerState) => /* @__PURE__ */ jsx("li", {
166
189
  ...props,
167
190
  className: cx("MuiMenuItem-root", props.className),
191
+ "data-_sk-dense": ownerState.size === "small" ? "" : void 0,
168
192
  children: ownerState.getOptionLabel(option)
169
193
  }, key),
170
194
  slotProps: {
@@ -176,9 +200,12 @@ function createTheme() {
176
200
  // match Menu elevation
177
201
  },
178
202
  chip: {
179
- size: "small"
203
+ size: "small",
204
+ component: MuiAutocompleteChip,
205
+ deleteIcon: /* @__PURE__ */ jsx(MuiAutocompleteChipDeleteIcon, {})
180
206
  },
181
207
  clearIndicator: {
208
+ component: MuiAutocompleteClearIndicator,
182
209
  tabIndex: 0,
183
210
  // make clear indicator focusable
184
211
  size: "small"
@@ -223,7 +250,12 @@ function createTheme() {
223
250
  MuiBadge: {
224
251
  defaultProps: {
225
252
  component: MuiBadge,
226
- color: "secondary"
253
+ color: "secondary",
254
+ slotProps: {
255
+ badge: {
256
+ component: MuiBadgeBadge
257
+ }
258
+ }
227
259
  }
228
260
  },
229
261
  MuiBottomNavigation: {
@@ -266,12 +298,16 @@ function createTheme() {
266
298
  },
267
299
  MuiCard: {
268
300
  defaultProps: {
269
- component: MuiCard
301
+ component: MuiCard,
302
+ variant: "outlined"
270
303
  }
271
304
  },
272
305
  MuiCardActionArea: {
273
306
  defaultProps: {
274
- component: MuiCardActionArea
307
+ component: MuiCardActionArea,
308
+ slots: {
309
+ focusHighlight: Nothing
310
+ }
275
311
  }
276
312
  },
277
313
  MuiCardContent: {
@@ -285,7 +321,7 @@ function createTheme() {
285
321
  slotProps: {
286
322
  title: {
287
323
  // biome-ignore lint/suspicious/noExplicitAny: MUI's CardHeader.title.component is hardcoded to "span"
288
- component: Role.h2
324
+ component: MuiCardHeaderTitle
289
325
  }
290
326
  }
291
327
  }
@@ -410,50 +446,7 @@ function createTheme() {
410
446
  defaultProps: {
411
447
  component: Role.a,
412
448
  color: "textPrimary"
413
- },
414
- variants: [{
415
- props: {
416
- color: "primary"
417
- },
418
- style: {
419
- color: "var(--stratakit-color-text-accent-strong)"
420
- }
421
- }, {
422
- props: {
423
- color: "secondary"
424
- },
425
- style: {
426
- color: "var(--stratakit-color-text-neutral-primary)"
427
- }
428
- }, {
429
- props: {
430
- color: "error"
431
- },
432
- style: {
433
- color: "var(--stratakit-color-text-critical-base)"
434
- }
435
- }, {
436
- props: {
437
- color: "info"
438
- },
439
- style: {
440
- color: "var(--stratakit-color-text-info-base)"
441
- }
442
- }, {
443
- props: {
444
- color: "success"
445
- },
446
- style: {
447
- color: "var(--stratakit-color-text-positive-base)"
448
- }
449
- }, {
450
- props: {
451
- color: "warning"
452
- },
453
- style: {
454
- color: "var(--stratakit-color-text-attention-base)"
455
- }
456
- }]
449
+ }
457
450
  },
458
451
  MuiList: {
459
452
  defaultProps: {
@@ -487,7 +480,16 @@ function createTheme() {
487
480
  },
488
481
  MuiMenu: {
489
482
  defaultProps: {
490
- component: Role.div
483
+ component: Role.div,
484
+ slots: {
485
+ list: MuiMenuListSlot
486
+ },
487
+ slotProps: {
488
+ paper: {
489
+ role: "presentation"
490
+ // Removes role="dialog"
491
+ }
492
+ }
491
493
  }
492
494
  },
493
495
  MuiMenuItem: {
@@ -507,7 +509,8 @@ function createTheme() {
507
509
  },
508
510
  MuiModal: {
509
511
  defaultProps: {
510
- component: Role.div
512
+ component: Role.div,
513
+ container
511
514
  }
512
515
  },
513
516
  MuiOutlinedInput: {
@@ -541,6 +544,12 @@ function createTheme() {
541
544
  MuiPopover: {
542
545
  defaultProps: {
543
546
  component: Role.div,
547
+ disableScrollLock: true,
548
+ // Popover passes down `container` prop to `Modal` https://github.com/mui/material-ui/blob/708ef10e874efa63d2e4972bd902befa1912f2dc/packages/mui-material/src/Popover/Popover.js#L389
549
+ container,
550
+ slots: {
551
+ paper: MuiPopoverPaperSlot
552
+ },
544
553
  slotProps: {
545
554
  paper: {
546
555
  role: "dialog"
@@ -548,6 +557,11 @@ function createTheme() {
548
557
  }
549
558
  }
550
559
  },
560
+ MuiPopper: {
561
+ defaultProps: {
562
+ container
563
+ }
564
+ },
551
565
  MuiRadio: {
552
566
  defaultProps: {
553
567
  component: Role.span,
@@ -650,7 +664,25 @@ function createTheme() {
650
664
  },
651
665
  MuiTabs: {
652
666
  defaultProps: {
653
- component: Role.div
667
+ component: MuiTabs,
668
+ allowScrollButtonsMobile: true,
669
+ slotProps: {
670
+ scrollButtons: {
671
+ "aria-hidden": true
672
+ },
673
+ startScrollButtonIcon: {
674
+ component: ChevronLeftIcon
675
+ },
676
+ endScrollButtonIcon: {
677
+ component: ChevronRightIcon
678
+ }
679
+ }
680
+ }
681
+ },
682
+ MuiTab: {
683
+ defaultProps: {
684
+ component: MuiTab,
685
+ iconPosition: "start"
654
686
  }
655
687
  },
656
688
  MuiTable: {
@@ -750,9 +782,60 @@ function createTheme() {
750
782
  },
751
783
  MuiTypography: {
752
784
  defaultProps: {
753
- variant: "body2",
785
+ variant: "inherit",
786
+ variantMapping,
754
787
  component: MuiTypography
755
- }
788
+ },
789
+ variants: [{
790
+ props: {
791
+ color: "primary"
792
+ },
793
+ style: {
794
+ color: "var(--stratakit-color-text-accent-strong)"
795
+ }
796
+ }, {
797
+ props: {
798
+ color: "secondary"
799
+ },
800
+ style: {
801
+ color: "var(--stratakit-color-text-neutral-primary)"
802
+ }
803
+ }, {
804
+ props: {
805
+ color: "textTertiary"
806
+ },
807
+ style: {
808
+ color: "var(--stratakit-color-text-neutral-tertiary)"
809
+ }
810
+ }, {
811
+ props: {
812
+ color: "error"
813
+ },
814
+ style: {
815
+ color: "var(--stratakit-color-text-critical-base)"
816
+ }
817
+ }, {
818
+ props: {
819
+ color: "info"
820
+ },
821
+ style: {
822
+ color: "var(--stratakit-color-text-info-base)"
823
+ }
824
+ }, {
825
+ props: {
826
+ color: "success"
827
+ },
828
+ style: {
829
+ color: "var(--stratakit-color-text-positive-base)"
830
+ }
831
+ }, {
832
+ props: {
833
+ color: "warning"
834
+ },
835
+ style: {
836
+ color: "var(--stratakit-color-text-attention-base)"
837
+ }
838
+ }]
756
839
  }
757
840
  }
758
841
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stratakit/mui",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "types": "./dist/index.d.ts",
@@ -45,22 +45,22 @@
45
45
  "design system"
46
46
  ],
47
47
  "dependencies": {
48
- "@ariakit/react": "^0.4.25",
48
+ "@ariakit/react": "^0.4.29",
49
49
  "@emotion/cache": "^11.14.0",
50
50
  "@emotion/react": "^11.14.0",
51
51
  "@emotion/styled": "^11.14.1",
52
- "@stratakit/foundations": "^0.4.8",
53
- "@stratakit/icons": "^0.3.1",
52
+ "@stratakit/foundations": "^0.4.9",
53
+ "@stratakit/icons": "^0.4.0",
54
54
  "classnames": "^2.5.1",
55
55
  "react-compiler-runtime": "^1.0.0"
56
56
  },
57
57
  "devDependencies": {
58
- "@types/react": "^19.2.14",
58
+ "@types/react": "^19.2.16",
59
59
  "@types/react-dom": "^19.2.3",
60
- "esbuild": "^0.27.7",
61
- "react": "^19.2.5",
62
- "react-dom": "^19.2.5",
63
- "typescript": "~5.9.3"
60
+ "esbuild": "^0.28.0",
61
+ "react": "^19.2.7",
62
+ "react-dom": "^19.2.7",
63
+ "typescript": "~6.0.3"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@mui/material": "^9.0.0",