@superdispatch/ui-lab 0.21.8 → 0.21.12

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 (97) hide show
  1. package/.babelrc.js +5 -0
  2. package/.turbo/turbo-version.log +28 -0
  3. package/package.json +59 -34
  4. package/pkg/README.md +10 -0
  5. package/{dist-node → pkg/dist-node}/index.js +25 -23
  6. package/pkg/dist-node/index.js.map +1 -0
  7. package/{dist-src → pkg/dist-src}/alert/Alert.js +2 -4
  8. package/{dist-src → pkg/dist-src}/banner/Banner.js +0 -0
  9. package/{dist-src → pkg/dist-src}/box/Box.js +0 -0
  10. package/{dist-src → pkg/dist-src}/button/Button.js +0 -0
  11. package/{dist-src → pkg/dist-src}/button-area/ButtonArea.js +0 -0
  12. package/{dist-src → pkg/dist-src}/container/Container.js +0 -0
  13. package/{dist-src → pkg/dist-src}/description-item/DescriptionItem.js +0 -0
  14. package/{dist-src → pkg/dist-src}/file-drop-zone/FileDropZone.js +0 -0
  15. package/{dist-src → pkg/dist-src}/file-list-item/FileListItem.js +0 -0
  16. package/{dist-src → pkg/dist-src}/index.js +0 -0
  17. package/{dist-src → pkg/dist-src}/linked-text/LinkedText.js +0 -0
  18. package/{dist-src → pkg/dist-src}/multiline-text/MultilineText.js +0 -0
  19. package/{dist-src → pkg/dist-src}/navbar/Navbar.js +0 -0
  20. package/{dist-src → pkg/dist-src}/navbar/NavbarAccordion.js +5 -10
  21. package/{dist-src → pkg/dist-src}/navbar/NavbarAvatar.js +0 -0
  22. package/{dist-src → pkg/dist-src}/navbar/NavbarBottomBar.js +16 -6
  23. package/{dist-src → pkg/dist-src}/navbar/NavbarContext.js +0 -0
  24. package/{dist-src → pkg/dist-src}/navbar/NavbarItem.js +0 -0
  25. package/{dist-src → pkg/dist-src}/navbar/NavbarList.js +0 -0
  26. package/{dist-src → pkg/dist-src}/navbar/NavbarMenu.js +0 -0
  27. package/{dist-src → pkg/dist-src}/sidebar/Sidebar.js +0 -0
  28. package/{dist-src → pkg/dist-src}/sidebar/SidebarBackButton.js +0 -0
  29. package/{dist-src → pkg/dist-src}/sidebar/SidebarContainer.js +0 -0
  30. package/{dist-src → pkg/dist-src}/sidebar/SidebarContent.js +0 -0
  31. package/{dist-src → pkg/dist-src}/sidebar/SidebarDivider.js +0 -0
  32. package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItem.js +0 -0
  33. package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItemAction.js +0 -0
  34. package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItemAvatar.js +0 -0
  35. package/{dist-src → pkg/dist-src}/sidebar/SidebarMenuItemContext.js +0 -0
  36. package/{dist-src → pkg/dist-src}/sidebar/SidebarSubheader.js +0 -0
  37. package/{dist-src → pkg/dist-src}/text-box/TextBox.js +0 -0
  38. package/{dist-src → pkg/dist-src}/utils/RuleNormalizer.js +0 -0
  39. package/{dist-src → pkg/dist-src}/utils/mergeStyles.js +0 -0
  40. package/{dist-types → pkg/dist-types}/index.d.ts +308 -308
  41. package/{dist-web → pkg/dist-web}/index.js +26 -24
  42. package/pkg/dist-web/index.js.map +1 -0
  43. package/pkg/package.json +34 -0
  44. package/playroom.ts +23 -0
  45. package/src/alert/Alert.stories.tsx +105 -0
  46. package/src/alert/Alert.tsx +108 -0
  47. package/src/banner/Banner.stories.tsx +64 -0
  48. package/src/banner/Banner.tsx +120 -0
  49. package/src/box/Box.stories.tsx +20 -0
  50. package/src/box/Box.tsx +252 -0
  51. package/src/button/Button.stories.tsx +717 -0
  52. package/src/button/Button.tsx +460 -0
  53. package/src/button-area/ButtonArea.stories.tsx +65 -0
  54. package/src/button-area/ButtonArea.tsx +88 -0
  55. package/src/container/Container.tsx +48 -0
  56. package/src/description-item/DescriptionItem.stories.tsx +163 -0
  57. package/src/description-item/DescriptionItem.tsx +104 -0
  58. package/src/file-drop-zone/FileDropZone.stories.tsx +44 -0
  59. package/src/file-drop-zone/FileDropZone.tsx +170 -0
  60. package/src/file-list-item/FileListItem.stories.tsx +37 -0
  61. package/src/file-list-item/FileListItem.tsx +145 -0
  62. package/src/file-list-item/__tests__/FileListItem.spec.tsx +339 -0
  63. package/src/index.spec.ts +43 -0
  64. package/src/index.ts +28 -0
  65. package/src/linked-text/LinkeText.stories.tsx +42 -0
  66. package/src/linked-text/LinkedText.tsx +47 -0
  67. package/src/multiline-text/MultilineText.stories.tsx +30 -0
  68. package/src/multiline-text/MultilineText.ts +16 -0
  69. package/src/navbar/Navbar.stories.tsx +135 -0
  70. package/src/navbar/Navbar.tsx +111 -0
  71. package/src/navbar/NavbarAccordion.tsx +171 -0
  72. package/src/navbar/NavbarAvatar.tsx +51 -0
  73. package/src/navbar/NavbarBottomBar.tsx +135 -0
  74. package/src/navbar/NavbarContext.tsx +23 -0
  75. package/src/navbar/NavbarItem.tsx +119 -0
  76. package/src/navbar/NavbarList.tsx +225 -0
  77. package/src/navbar/NavbarMenu.tsx +102 -0
  78. package/src/sidebar/Sidebar.stories.tsx +363 -0
  79. package/src/sidebar/Sidebar.tsx +73 -0
  80. package/src/sidebar/SidebarBackButton.tsx +33 -0
  81. package/src/sidebar/SidebarContainer.tsx +114 -0
  82. package/src/sidebar/SidebarContent.tsx +119 -0
  83. package/src/sidebar/SidebarDivider.tsx +15 -0
  84. package/src/sidebar/SidebarMenuItem.tsx +211 -0
  85. package/src/sidebar/SidebarMenuItemAction.tsx +27 -0
  86. package/src/sidebar/SidebarMenuItemAvatar.tsx +59 -0
  87. package/src/sidebar/SidebarMenuItemContext.tsx +33 -0
  88. package/src/sidebar/SidebarSubheader.tsx +38 -0
  89. package/src/styled.d.ts +12 -0
  90. package/src/text-box/TextBox.stories.tsx +108 -0
  91. package/src/text-box/TextBox.tsx +229 -0
  92. package/src/utils/RuleNormalizer.ts +24 -0
  93. package/src/utils/mergeStyles.ts +28 -0
  94. package/tsconfig.json +19 -0
  95. package/LICENSE +0 -21
  96. package/dist-node/index.js.map +0 -1
  97. package/dist-web/index.js.map +0 -1
package/.babelrc.js ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const createBabelConfig = require('../../config/createBabelConfig');
4
+
5
+ module.exports = createBabelConfig();
@@ -0,0 +1,28 @@
1
+ @superdispatch/ui-lab:version: cache hit, replaying output 45a0d783a7139ee5
2
+ @superdispatch/ui-lab:version: $ pika build
3
+ @superdispatch/ui-lab:version: @pika/pack v0.5.0
4
+ @superdispatch/ui-lab:version: [1/8] Validating source...
5
+ @superdispatch/ui-lab:version: [2/8] Preparing pipeline...
6
+ @superdispatch/ui-lab:version:  ❇️ pkg/
7
+ @superdispatch/ui-lab:version: [3/8] Running @pika/plugin-standard-pkg...
8
+ @superdispatch/ui-lab:version: Browserslist: caniuse-lite is outdated. Please run:
9
+ @superdispatch/ui-lab:version:  npx browserslist@latest --update-db
10
+ @superdispatch/ui-lab:version:  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
11
+ @superdispatch/ui-lab:version:  📝 pkg/dist-src/index.js [esnext]
12
+ @superdispatch/ui-lab:version:  » Linting with standard-pkg...
13
+ @superdispatch/ui-lab:version: [4/8] Running @pika/plugin-build-web...
14
+ @superdispatch/ui-lab:version:  📝 pkg/dist-web/index.js [module]
15
+ @superdispatch/ui-lab:version: [5/8] Running @pika/plugin-build-node...
16
+ @superdispatch/ui-lab:version:  📝 pkg/dist-node/index.js [main]
17
+ @superdispatch/ui-lab:version: [6/8] Running @pika/plugin-build-types...
18
+ @superdispatch/ui-lab:version:  » no manual type definitions found, auto-generating...
19
+ @superdispatch/ui-lab:version:  📝 pkg/dist-types/index.d.ts [types]
20
+ @superdispatch/ui-lab:version: [7/8] Running @pika/plugin-bundle-types...
21
+ @superdispatch/ui-lab:version: Circular dependency: pkg/dist-types/navbar/NavbarList.d.ts -> pkg/dist-types/navbar/NavbarAccordion.d.ts -> pkg/dist-types/navbar/NavbarList.d.ts
22
+ @superdispatch/ui-lab:version: 'Context' is imported from external module 'react' but never used
23
+ @superdispatch/ui-lab:version:  📝 pkg/dist-types/index.d.ts
24
+ @superdispatch/ui-lab:version: [8/8] Finalizing package...
25
+ @superdispatch/ui-lab:version:  » copying README.md...
26
+ @superdispatch/ui-lab:version:  📝 pkg/package.json
27
+ @superdispatch/ui-lab:version:  📦 pkg/
28
+ @superdispatch/ui-lab:version: Done in 14.05s.
package/package.json CHANGED
@@ -1,34 +1,59 @@
1
- {
2
- "name": "@superdispatch/ui-lab",
3
- "version": "0.21.8",
4
- "license": "MIT",
5
- "files": [
6
- "dist-*/",
7
- "bin/"
8
- ],
9
- "pika": true,
10
- "sideEffects": false,
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/superdispatch/ui.git"
14
- },
15
- "dependencies": {
16
- "@superdispatch/hooks": "^0.21.0",
17
- "@superdispatch/ui": "^0.21.8",
18
- "react-anchorme": "^2.2.1",
19
- "react-dropzone": "^11.3.4"
20
- },
21
- "peerDependencies": {
22
- "@babel/runtime": "^7.0.0",
23
- "react": "^17.0.2",
24
- "styled-components": "^5.2.1"
25
- },
26
- "publishConfig": {
27
- "access": "public",
28
- "directory": "pkg"
29
- },
30
- "esnext": "dist-src/index.js",
31
- "module": "dist-web/index.js",
32
- "main": "dist-node/index.js",
33
- "types": "dist-types/index.d.ts"
34
- }
1
+ {
2
+ "name": "@superdispatch/ui-lab",
3
+ "version": "0.21.12",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/superdispatch/ui.git"
7
+ },
8
+ "license": "MIT",
9
+ "main": "src/index.ts",
10
+ "module": "src/index.ts",
11
+ "browser": "pkg/dist-web/index.js",
12
+ "types": "src/index.ts",
13
+ "scripts": {
14
+ "version": "pika build"
15
+ },
16
+ "dependencies": {
17
+ "@superdispatch/hooks": "^0.21.0",
18
+ "@superdispatch/ui": "^0.21.8",
19
+ "react-anchorme": "^2.2.1",
20
+ "react-dropzone": "^11.3.4"
21
+ },
22
+ "peerDependencies": {
23
+ "@babel/runtime": "^7.0.0",
24
+ "react": "^17.0.2",
25
+ "styled-components": "^5.2.1"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "directory": "pkg"
30
+ },
31
+ "@pika/pack": {
32
+ "pipeline": [
33
+ [
34
+ "@pika/plugin-standard-pkg",
35
+ {
36
+ "exclude": [
37
+ "**/*.spec.*",
38
+ "**/*.stories.*",
39
+ "**/*.playroom.*",
40
+ "**/__tests__/**",
41
+ "**/__testutils__/**"
42
+ ]
43
+ }
44
+ ],
45
+ [
46
+ "@pika/plugin-build-web"
47
+ ],
48
+ [
49
+ "@pika/plugin-build-node"
50
+ ],
51
+ [
52
+ "@pika/plugin-build-types"
53
+ ],
54
+ [
55
+ "@pika/plugin-bundle-types"
56
+ ]
57
+ ]
58
+ }
59
+ }
package/pkg/README.md ADDED
@@ -0,0 +1,10 @@
1
+ ### `@superdispatch/ui-lab`
2
+
3
+ [![npm](https://img.shields.io/npm/v/@superdispatch/ui-lab)](https://www.npmjs.com/package/@superdispatch/ui-lab)
4
+ [![npm minzipped size](https://img.shields.io/bundlephobia/minzip/@superdispatch/ui-lab.svg)](https://bundlephobia.com/result?p=@superdispatch/ui-lab)
5
+
6
+ #### Installation
7
+
8
+ ```bash
9
+ yarn add @superdispatch/ui-lab
10
+ ```
@@ -41,7 +41,7 @@ var iconMapping = {
41
41
  var Alert = /*#__PURE__*/react.forwardRef((_ref, ref) => {
42
42
  var {
43
43
  children,
44
- onClose: _onClose,
44
+ onClose,
45
45
  severity = 'positive'
46
46
  } = _ref;
47
47
  return /*#__PURE__*/jsxRuntime.jsx(StyledAlert, {
@@ -49,9 +49,7 @@ var Alert = /*#__PURE__*/react.forwardRef((_ref, ref) => {
49
49
  variant: "outlined",
50
50
  iconMapping: iconMapping,
51
51
  severity: toMaterialSeverity(severity),
52
- onClose: () => {
53
- _onClose === null || _onClose === void 0 ? void 0 : _onClose();
54
- },
52
+ onClose: onClose,
55
53
  children: children
56
54
  });
57
55
  });
@@ -1076,6 +1074,7 @@ function useNavbarContext() {
1076
1074
  return react.useContext(NavbarContext);
1077
1075
  }
1078
1076
 
1077
+ var _excluded$7 = ["active", "hasBadge"];
1079
1078
  var StyledBottomNavigation = /*#__PURE__*/styled__default(core.BottomNavigation).withConfig({
1080
1079
  displayName: "NavbarBottomBar__StyledBottomNavigation",
1081
1080
  componentId: "SD__sc-9z6v3k-0"
@@ -1114,12 +1113,20 @@ function NavbarBottomBar(_ref) {
1114
1113
  }
1115
1114
  }
1116
1115
  },
1117
- children: [items.map(item => /*#__PURE__*/react.createElement(StyledBottomNavigationAction, _objectSpread(_objectSpread({}, item), {}, {
1118
- key: item.value,
1119
- icon: item.hasBadge ? /*#__PURE__*/jsxRuntime.jsxs(IconWrapper, {
1120
- children: [/*#__PURE__*/jsxRuntime.jsx(IconLabel, {}), item.icon]
1121
- }) : item.icon
1122
- }))), /*#__PURE__*/jsxRuntime.jsx(StyledBottomNavigationAction, {
1116
+ children: [items.map(_ref2 => {
1117
+ var {
1118
+ active,
1119
+ hasBadge
1120
+ } = _ref2,
1121
+ item = _objectWithoutProperties(_ref2, _excluded$7);
1122
+
1123
+ return /*#__PURE__*/react.createElement(StyledBottomNavigationAction, _objectSpread(_objectSpread({}, item), {}, {
1124
+ key: item.value,
1125
+ icon: hasBadge ? /*#__PURE__*/jsxRuntime.jsxs(IconWrapper, {
1126
+ children: [/*#__PURE__*/jsxRuntime.jsx(IconLabel, {}), item.icon]
1127
+ }) : item.icon
1128
+ }));
1129
+ }), /*#__PURE__*/jsxRuntime.jsx(StyledBottomNavigationAction, {
1123
1130
  value: "menu",
1124
1131
  label: "Menu",
1125
1132
  icon: hasMenuBadge ? /*#__PURE__*/jsxRuntime.jsxs(IconWrapper, {
@@ -1190,12 +1197,7 @@ var NavbarAccordionLabel = /*#__PURE__*/styled__default.span.withConfig({
1190
1197
  var NavbarAccordionRoot = /*#__PURE__*/styled__default(core.Accordion).withConfig({
1191
1198
  displayName: "NavbarAccordion__NavbarAccordionRoot",
1192
1199
  componentId: "SD__sc-1s7g3kw-1"
1193
- })(_ref => {
1194
- var {
1195
- gutter
1196
- } = _ref;
1197
- return styled.css(["width:100%;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;background-color:#1b2638;margin-top:", ";&[aria-current]{background-color:#2f394a;color:", ";}&.MuiAccordion-root:before{background-color:#1b2638;}&.MuiPaper-elevation0{border:0px;}&.MuiAccordion-root.Mui-expanded{margin-top:", ";}"], gutter ? '16px' : '0', ui.Color.White, gutter ? '16px' : '0');
1198
- });
1200
+ })(["width:100%;color:#c2c4c9;font-size:14px;font-weight:400;line-height:20px;text-decoration:none;outline:none;cursor:pointer;background-color:#1b2638;&[aria-current]{background-color:#2f394a;color:", ";}&.MuiAccordion-root:before{background-color:#1b2638;}&.MuiPaper-elevation0{border:0px;}&[data-gutter]{margin-top:16px;}&[data-gutter].MuiAccordion-root.Mui-expanded{margin-top:16px;}"], ui.Color.White);
1199
1201
  var NavbarAccordionSummary = /*#__PURE__*/styled__default(core.AccordionSummary).withConfig({
1200
1202
  displayName: "NavbarAccordion__NavbarAccordionSummary",
1201
1203
  componentId: "SD__sc-1s7g3kw-2"
@@ -1204,14 +1206,14 @@ var IconWrapper$2 = /*#__PURE__*/styled__default.div.withConfig({
1204
1206
  displayName: "NavbarAccordion__IconWrapper",
1205
1207
  componentId: "SD__sc-1s7g3kw-3"
1206
1208
  })(["width:24px;margin-right:8px;& svg{font-size:24px;}"]);
1207
- function NavbarAccordion(_ref2) {
1209
+ function NavbarAccordion(_ref) {
1208
1210
  var {
1209
1211
  label,
1210
1212
  icon,
1211
1213
  gutter,
1212
1214
  items,
1213
1215
  onClick: _onClick
1214
- } = _ref2;
1216
+ } = _ref;
1215
1217
  var uid = ui.useUID();
1216
1218
  var {
1217
1219
  setDrawerOpen,
@@ -1224,7 +1226,7 @@ function NavbarAccordion(_ref2) {
1224
1226
  }, [isNavbarExpanded]);
1225
1227
  return /*#__PURE__*/jsxRuntime.jsxs(NavbarAccordionRoot, {
1226
1228
  square: true,
1227
- gutter: !!gutter,
1229
+ "data-gutter": !gutter,
1228
1230
  "aria-labelledby": uid,
1229
1231
  expanded: isExpanded,
1230
1232
  onClick: event => {
@@ -1472,7 +1474,7 @@ function Navbar(_ref) {
1472
1474
  });
1473
1475
  }
1474
1476
 
1475
- var _excluded$7 = ["title", "subtitle", "children"];
1477
+ var _excluded$8 = ["title", "subtitle", "children"];
1476
1478
  var StyledTypography = /*#__PURE__*/styled__default(core.Typography).withConfig({
1477
1479
  displayName: "NavbarAvatar__StyledTypography",
1478
1480
  componentId: "SD__sc-19q2zd0-0"
@@ -1483,7 +1485,7 @@ function NavbarAvatar(_ref) {
1483
1485
  subtitle,
1484
1486
  children
1485
1487
  } = _ref,
1486
- props = _objectWithoutProperties(_ref, _excluded$7);
1488
+ props = _objectWithoutProperties(_ref, _excluded$8);
1487
1489
 
1488
1490
  var {
1489
1491
  isNavbarExpanded
@@ -1701,7 +1703,7 @@ var SidebarContainer = /*#__PURE__*/react.forwardRef((_ref, ref) => {
1701
1703
  });
1702
1704
  if (process.env.NODE_ENV !== "production") SidebarContainer.displayName = "SidebarContainer";
1703
1705
 
1704
- var _excluded$8 = ["onClick", "children"];
1706
+ var _excluded$9 = ["onClick", "children"];
1705
1707
  function SidebarBackButton(_ref) {
1706
1708
  var {
1707
1709
  onClick: _onClick,
@@ -1709,7 +1711,7 @@ function SidebarBackButton(_ref) {
1709
1711
  fontSize: "small"
1710
1712
  })
1711
1713
  } = _ref,
1712
- props = _objectWithoutProperties(_ref, _excluded$8);
1714
+ props = _objectWithoutProperties(_ref, _excluded$9);
1713
1715
 
1714
1716
  var isCollapsed = ui.useCollapseBreakpoint('sm');
1715
1717
  var {