@charcoal-ui/react 2.7.0 → 2.8.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.
package/dist/index.d.ts CHANGED
@@ -13,8 +13,8 @@ export { default as Icon, type IconProps } from './components/Icon';
13
13
  export { default as Modal, type ModalProps } from './components/Modal';
14
14
  export { ModalHeader, ModalAlign, ModalBody, ModalButtons, } from './components/Modal/ModalPlumbing';
15
15
  export { default as LoadingSpinner, LoadingSpinnerIcon, } from './components/LoadingSpinner';
16
- export { default as DropdownSelector, DropdownSelectorItem, } from './components/DropdownSelector';
16
+ export { default as DropdownSelector, type DropdownSelectorProps, DropdownSelectorItem, } from './components/DropdownSelector';
17
17
  export { default as SegmentedControl, type SegmentedControlProps, } from './components/SegmentedControl';
18
- export { default as Checkbox } from './components/Checkbox';
18
+ export { default as Checkbox, type CheckboxProps } from './components/Checkbox';
19
19
  export { default as TagItem, type TagItemProps } from './components/TagItem';
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,oBAAoB,EAC/B,uBAAuB,EACvB,KAAK,SAAS,GACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,KAAK,eAAe,GACrB,MAAM,y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,KAAK,qBAAqB,EAC1B,oBAAoB,GACrB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA"}
package/dist/index.esm.js CHANGED
@@ -1302,7 +1302,7 @@ function Modal({
1302
1302
  ...underlayProps,
1303
1303
  style: transitionEnabled ? { backgroundColor } : {}
1304
1304
  },
1305
- /* @__PURE__ */ React12.createElement(FocusScope, { contain: true, restoreFocus: true, autoFocus: true }, /* @__PURE__ */ React12.createElement(
1305
+ /* @__PURE__ */ React12.createElement(FocusScope, { contain: true, restoreFocus: true, autoFocus: true }, /* @__PURE__ */ React12.createElement(DialogContainer, { bottomSheet, size }, /* @__PURE__ */ React12.createElement(
1306
1306
  ModalDialog,
1307
1307
  {
1308
1308
  ref,
@@ -1328,7 +1328,7 @@ function Modal({
1328
1328
  }
1329
1329
  )
1330
1330
  )
1331
- ))
1331
+ )))
1332
1332
  ))
1333
1333
  );
1334
1334
  }
@@ -1340,6 +1340,8 @@ var ModalContext = React12.createContext({
1340
1340
  });
1341
1341
  var ModalBackground = animated(styled10.div`
1342
1342
  z-index: ${({ zIndex }) => zIndex};
1343
+ overflow: scroll;
1344
+ display: flex;
1343
1345
  position: fixed;
1344
1346
  top: 0;
1345
1347
  left: 0;
@@ -1348,34 +1350,52 @@ var ModalBackground = animated(styled10.div`
1348
1350
 
1349
1351
  ${theme((o) => [o.bg.surface4])}
1350
1352
  `);
1353
+ var DialogContainer = styled10.div`
1354
+ position: relative;
1355
+ margin: auto;
1356
+ padding: 24px 0;
1357
+ width: ${(p) => {
1358
+ switch (p.size) {
1359
+ case "S": {
1360
+ return columnSystem(3, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1361
+ }
1362
+ case "M": {
1363
+ return columnSystem(4, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1364
+ }
1365
+ case "L": {
1366
+ return columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1367
+ }
1368
+ default: {
1369
+ return unreachable(p.size);
1370
+ }
1371
+ }
1372
+ }}px;
1373
+
1374
+ @media ${({ theme: theme4 }) => maxWidth(theme4.breakpoint.screen1)} {
1375
+ width: calc(100% - 48px);
1376
+ ${(p) => p.bottomSheet !== false && css4`
1377
+ margin: 0;
1378
+ padding: 0;
1379
+ bottom: 0;
1380
+ position: absolute;
1381
+ width: 100%;
1382
+ ${p.bottomSheet === "full" ? "height: 100%" : ""};
1383
+ `}
1384
+ }
1385
+ `;
1351
1386
  var ModalDialog = animated(styled10.div`
1352
- position: absolute;
1353
- top: 50%;
1354
- left: 50%;
1355
- transform: translate(-50%, -50%);
1356
- width: ${(p) => p.size === "S" ? columnSystem(3, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2 : p.size === "M" ? columnSystem(4, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2 : p.size === "L" ? columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2 : unreachable(p.size)}px;
1387
+ position: relative;
1388
+ margin: auto;
1389
+ padding: 24px 0;
1357
1390
 
1358
1391
  ${theme((o) => [o.bg.background1, o.borderRadius(24)])}
1359
-
1360
1392
  @media ${({ theme: theme4 }) => maxWidth(theme4.breakpoint.screen1)} {
1361
- ${(p) => p.bottomSheet === "full" ? css4`
1362
- top: auto;
1363
- bottom: 0;
1364
- left: 0;
1365
- transform: none;
1366
- border-radius: 0;
1367
- width: 100%;
1368
- height: 100%;
1369
- ` : p.bottomSheet ? css4`
1370
- top: auto;
1371
- bottom: 0;
1372
- left: 0;
1373
- transform: none;
1374
- border-radius: 0;
1375
- width: 100%;
1376
- ` : css4`
1377
- width: calc(100% - 48px);
1378
- `}
1393
+ ${(p) => p.bottomSheet !== false && css4`
1394
+ border-radius: 0;
1395
+ ${p.bottomSheet === "full" && css4`
1396
+ height: 100%;
1397
+ `}
1398
+ `}
1379
1399
  }
1380
1400
  `);
1381
1401
  var ModalCrossButton = styled10(IconButton_default)`
@@ -1435,6 +1455,7 @@ function LoadingSpinner({
1435
1455
  return /* @__PURE__ */ React14.createElement(LoadingSpinnerRoot, { size, padding, transparent }, /* @__PURE__ */ React14.createElement(LoadingSpinnerIcon, null));
1436
1456
  }
1437
1457
  var LoadingSpinnerRoot = styled12.div.attrs({ role: "progressbar" })`
1458
+ box-sizing: content-box;
1438
1459
  margin: auto;
1439
1460
  padding: ${(props) => props.padding}px;
1440
1461
  border-radius: 8px;
@@ -1845,7 +1866,8 @@ var SegmentedControl = forwardRef(
1845
1866
  ...props,
1846
1867
  isDisabled: props.disabled,
1847
1868
  isReadOnly: props.readonly,
1848
- isRequired: props.required
1869
+ isRequired: props.required,
1870
+ "aria-label": props.name
1849
1871
  }),
1850
1872
  [props]
1851
1873
  );