@uniformdev/design-system 18.3.1-alpha.22 → 18.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.
package/dist/esm/index.js CHANGED
@@ -634,7 +634,7 @@ function macifyShortcut(shortcut) {
634
634
  if (shortcut === null) {
635
635
  return null;
636
636
  }
637
- return shortcut.replace(/alt/g, "option").replace(/(ctrl|control)/g, "command");
637
+ return shortcut.replace(/alt/g, "option").replace(/(ctrl|control)/g, "meta");
638
638
  }
639
639
  function useShortcut({
640
640
  handler,
@@ -653,13 +653,13 @@ function useShortcut({
653
653
  if (!doNotPreventDefault) {
654
654
  event.preventDefault();
655
655
  }
656
- handler(event);
656
+ handler == null ? void 0 : handler(event);
657
657
  },
658
658
  activeWhenEditing ? {
659
659
  enableOnContentEditable: true,
660
- enableOnTags: ["INPUT", "SELECT", "TEXTAREA"]
660
+ enableOnFormTags: true
661
661
  } : {},
662
- [handler, doNotPreventDefault]
662
+ [handler, doNotPreventDefault, activeWhenEditing]
663
663
  );
664
664
  }
665
665
 
@@ -667,7 +667,7 @@ function useShortcut({
667
667
  import { jsx as jsx3 } from "@emotion/react/jsx-runtime";
668
668
  var loggedHotkeyConsole = false;
669
669
  var Context = React2.createContext(false);
670
- var revealHotkey = ["ctrl+F1", "option+shift+/"];
670
+ var revealHotkey = ["ctrl+F1", "ctrl+shift+/"];
671
671
  function ShortcutContext({ children }) {
672
672
  const [reveal, setReveal] = useState(false);
673
673
  useEffect(() => {
@@ -692,7 +692,7 @@ function ShortcutContext({ children }) {
692
692
  return /* @__PURE__ */ jsx3(Context.Provider, { value: reveal, children });
693
693
  }
694
694
  function computeDisplayedHotkey(shortcut) {
695
- return shortcut.replace(/(command|cmd)/g, "\u2318").replace(/option/g, "\u2325").replace(/shift/g, "\u21E7").replace(/ctrl/g, "\u2303");
695
+ return shortcut.replace(/meta/g, "\u2318").replace(/option/g, "\u2325").replace(/shift/g, "\u21E7").replace(/ctrl/g, "\u2303");
696
696
  }
697
697
  function ShortcutRevealer({
698
698
  shortcut,
@@ -5151,7 +5151,9 @@ export {
5151
5151
  input,
5152
5152
  inputError,
5153
5153
  inputSelect,
5154
+ isMacLike,
5154
5155
  labelText,
5156
+ macifyShortcut,
5155
5157
  mq,
5156
5158
  ripple,
5157
5159
  scrollbarStyles,
@@ -5161,5 +5163,6 @@ export {
5161
5163
  useCurrentTab,
5162
5164
  useDrawer,
5163
5165
  useIconContext,
5164
- useMenuContext
5166
+ useMenuContext,
5167
+ useShortcut
5165
5168
  };
package/dist/index.d.ts CHANGED
@@ -993,6 +993,17 @@ declare function ShortcutRevealer({ shortcut, macShortcut, className, }: {
993
993
  className?: SerializedStyles | string;
994
994
  }): _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
995
995
 
996
+ declare const isMacLike: boolean;
997
+ type UseShortcutOptions = {
998
+ shortcut: string | null;
999
+ macShortcut?: string | null;
1000
+ handler: (event: KeyboardEvent) => void;
1001
+ doNotPreventDefault?: boolean;
1002
+ activeWhenEditing?: boolean;
1003
+ };
1004
+ declare function macifyShortcut(shortcut: string | null): string | null;
1005
+ declare function useShortcut({ handler, shortcut, macShortcut, doNotPreventDefault, activeWhenEditing, }: UseShortcutOptions): void;
1006
+
996
1007
  type SwitchProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'type'> & {
997
1008
  /** sets the label value */
998
1009
  label: string;
@@ -1326,4 +1337,4 @@ type StatusBulletProps = React$1.HTMLAttributes<HTMLSpanElement> & {
1326
1337
  };
1327
1338
  declare const StatusBullet: ({ status, hideText, message, ...props }: StatusBulletProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1328
1339
 
1329
- export { ActionButtonsProps, AddButton, AddButtonProps, AddListButton, AddListButtonProps, AddListButtonThemeProps, ArrowPositionProps, Badge, BadgeProps, BoxHeightProps, BreakpointSize, BreakpointsMap, Button, ButtonProps, ButtonSizeProps, ButtonThemeProps$1 as ButtonThemeProps, ButtonWithMenu, ButtonWithMenuProps, Callout, CalloutProps, CalloutType, Caption, CaptionProps, Card, CardContainer, CardContainerBgColorProps, CardContainerProps, CardProps, CheckboxWithInfo, CheckboxWithInforProps, ChildFunction, ComboBoxGroupBase, Counter, CounterProps, CreateTeamIntegrationTile, CreateTeamIntegrationTileProps, DashedBox, DashedBoxProps, Details, DetailsProps, Drawer, DrawerContextValue, DrawerItem, DrawerProps, DrawerProvider, DrawerRenderer, DrawerRendererItemProps, DrawerRendererProps, EditTeamIntegrationTile, EditTeamIntegrationTileProps, ErrorMessage, ErrorMessageProps, Fieldset, FieldsetProps, Heading, HeadingProps, HexModalBackground, Icon, IconColor, IconName, IconProps, IconType, IconsProvider, InlineAlert, InlineAlertProps, Input, InputComboBox, InputComboBoxOption, InputComboBoxProps, InputInlineSelect, InputInlineSelectOption, InputInlineSelectProps, InputKeywordSearch, InputKeywordSearchProps, InputProps, InputSelect, InputSelectProps, InputToggle, InputToggleProps, IntegrationComingSoon, IntegrationComingSoonProps, IntegrationHeaderSection, IntegrationHeaderSectionProps, IntegrationLoadingTile, IntegrationLoadingTileProps, IntegrationModalHeader, IntegrationModalHeaderProps, IntegrationModalIcon, IntegrationModalIconProps, IntegrationTile, IntegrationTileProps, Label, LabelProps, Legend, LegendProps, LevelProps, LimitsBar, LimitsBarProps, Link, LinkColorProps, LinkList, LinkListProps, LinkManagerWithRefType, LinkProps, LinkWithRef, LoadingIcon, LoadingIconProps, LoadingIndicator, LoadingOverlay, LoadingOverlayProps, Menu, MenuContext, MenuItem, MenuItemProps, MenuItemSeparator, MenuItemTextThemeProps, MenuProps, PageHeaderSection, PageHeaderSectionProps, Paragraph, ParagraphProps, RegisterDrawerProps, ResolveIcon, ResolveIconProps, ScrollableItemProps, ScrollableList, ScrollableListInputItem, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, ShortcutContext, ShortcutRevealer, StatusBullet, StatusBulletProps, StatusTypeProps, Switch, SwitchProps, TabButton, TabButtonGroup, TabButtonProps, TabContent, TabContentProps, Table, TableBody, TableBodyProps, TableCellData, TableCellDataProps, TableCellHead, TableCellHeadProps, TableFoot, TableFootProps, TableHead, TableHeadProps, TableProps, TableRow, TableRowProps, Tabs, TabsProps, TextAlignProps, Textarea, TextareaProps, Theme, ThemeProps, TileContainer, TileContainerProps, UniformBadge, UniformLogo, UniformLogoProps, WarningMessage, WarningMessageProps, breakpoints, button, buttonGhost, buttonPrimary, buttonRippleEffect, buttonSecondary, buttonSecondaryInvert, buttonTertiary, buttonUnimportant, fadeIn, fadeInBottom, fadeInLtr, fadeInRtl, fadeOutBottom, growSubtle, input, inputError, inputSelect, labelText, mq, ripple, scrollbarStyles, skeletonLoading, supports, useBreakpoint, useCurrentTab, useDrawer, useIconContext, useMenuContext };
1340
+ export { ActionButtonsProps, AddButton, AddButtonProps, AddListButton, AddListButtonProps, AddListButtonThemeProps, ArrowPositionProps, Badge, BadgeProps, BoxHeightProps, BreakpointSize, BreakpointsMap, Button, ButtonProps, ButtonSizeProps, ButtonThemeProps$1 as ButtonThemeProps, ButtonWithMenu, ButtonWithMenuProps, Callout, CalloutProps, CalloutType, Caption, CaptionProps, Card, CardContainer, CardContainerBgColorProps, CardContainerProps, CardProps, CheckboxWithInfo, CheckboxWithInforProps, ChildFunction, ComboBoxGroupBase, Counter, CounterProps, CreateTeamIntegrationTile, CreateTeamIntegrationTileProps, DashedBox, DashedBoxProps, Details, DetailsProps, Drawer, DrawerContextValue, DrawerItem, DrawerProps, DrawerProvider, DrawerRenderer, DrawerRendererItemProps, DrawerRendererProps, EditTeamIntegrationTile, EditTeamIntegrationTileProps, ErrorMessage, ErrorMessageProps, Fieldset, FieldsetProps, Heading, HeadingProps, HexModalBackground, Icon, IconColor, IconName, IconProps, IconType, IconsProvider, InlineAlert, InlineAlertProps, Input, InputComboBox, InputComboBoxOption, InputComboBoxProps, InputInlineSelect, InputInlineSelectOption, InputInlineSelectProps, InputKeywordSearch, InputKeywordSearchProps, InputProps, InputSelect, InputSelectProps, InputToggle, InputToggleProps, IntegrationComingSoon, IntegrationComingSoonProps, IntegrationHeaderSection, IntegrationHeaderSectionProps, IntegrationLoadingTile, IntegrationLoadingTileProps, IntegrationModalHeader, IntegrationModalHeaderProps, IntegrationModalIcon, IntegrationModalIconProps, IntegrationTile, IntegrationTileProps, Label, LabelProps, Legend, LegendProps, LevelProps, LimitsBar, LimitsBarProps, Link, LinkColorProps, LinkList, LinkListProps, LinkManagerWithRefType, LinkProps, LinkWithRef, LoadingIcon, LoadingIconProps, LoadingIndicator, LoadingOverlay, LoadingOverlayProps, Menu, MenuContext, MenuItem, MenuItemProps, MenuItemSeparator, MenuItemTextThemeProps, MenuProps, PageHeaderSection, PageHeaderSectionProps, Paragraph, ParagraphProps, RegisterDrawerProps, ResolveIcon, ResolveIconProps, ScrollableItemProps, ScrollableList, ScrollableListInputItem, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, ShortcutContext, ShortcutRevealer, StatusBullet, StatusBulletProps, StatusTypeProps, Switch, SwitchProps, TabButton, TabButtonGroup, TabButtonProps, TabContent, TabContentProps, Table, TableBody, TableBodyProps, TableCellData, TableCellDataProps, TableCellHead, TableCellHeadProps, TableFoot, TableFootProps, TableHead, TableHeadProps, TableProps, TableRow, TableRowProps, Tabs, TabsProps, TextAlignProps, Textarea, TextareaProps, Theme, ThemeProps, TileContainer, TileContainerProps, UniformBadge, UniformLogo, UniformLogoProps, UseShortcutOptions, WarningMessage, WarningMessageProps, breakpoints, button, buttonGhost, buttonPrimary, buttonRippleEffect, buttonSecondary, buttonSecondaryInvert, buttonTertiary, buttonUnimportant, fadeIn, fadeInBottom, fadeInLtr, fadeInRtl, fadeOutBottom, growSubtle, input, inputError, inputSelect, isMacLike, labelText, macifyShortcut, mq, ripple, scrollbarStyles, skeletonLoading, supports, useBreakpoint, useCurrentTab, useDrawer, useIconContext, useMenuContext, useShortcut };
package/dist/index.js CHANGED
@@ -121,7 +121,9 @@ __export(src_exports, {
121
121
  input: () => input,
122
122
  inputError: () => inputError,
123
123
  inputSelect: () => inputSelect,
124
+ isMacLike: () => isMacLike,
124
125
  labelText: () => labelText,
126
+ macifyShortcut: () => macifyShortcut,
125
127
  mq: () => mq,
126
128
  ripple: () => ripple,
127
129
  scrollbarStyles: () => scrollbarStyles,
@@ -131,7 +133,8 @@ __export(src_exports, {
131
133
  useCurrentTab: () => useCurrentTab,
132
134
  useDrawer: () => useDrawer,
133
135
  useIconContext: () => useIconContext,
134
- useMenuContext: () => useMenuContext
136
+ useMenuContext: () => useMenuContext,
137
+ useShortcut: () => useShortcut
135
138
  });
136
139
  module.exports = __toCommonJS(src_exports);
137
140
 
@@ -771,7 +774,7 @@ function macifyShortcut(shortcut) {
771
774
  if (shortcut === null) {
772
775
  return null;
773
776
  }
774
- return shortcut.replace(/alt/g, "option").replace(/(ctrl|control)/g, "command");
777
+ return shortcut.replace(/alt/g, "option").replace(/(ctrl|control)/g, "meta");
775
778
  }
776
779
  function useShortcut({
777
780
  handler,
@@ -790,13 +793,13 @@ function useShortcut({
790
793
  if (!doNotPreventDefault) {
791
794
  event.preventDefault();
792
795
  }
793
- handler(event);
796
+ handler == null ? void 0 : handler(event);
794
797
  },
795
798
  activeWhenEditing ? {
796
799
  enableOnContentEditable: true,
797
- enableOnTags: ["INPUT", "SELECT", "TEXTAREA"]
800
+ enableOnFormTags: true
798
801
  } : {},
799
- [handler, doNotPreventDefault]
802
+ [handler, doNotPreventDefault, activeWhenEditing]
800
803
  );
801
804
  }
802
805
 
@@ -804,7 +807,7 @@ function useShortcut({
804
807
  var import_jsx_runtime2 = require("@emotion/react/jsx-runtime");
805
808
  var loggedHotkeyConsole = false;
806
809
  var Context = import_react7.default.createContext(false);
807
- var revealHotkey = ["ctrl+F1", "option+shift+/"];
810
+ var revealHotkey = ["ctrl+F1", "ctrl+shift+/"];
808
811
  function ShortcutContext({ children }) {
809
812
  const [reveal, setReveal] = (0, import_react7.useState)(false);
810
813
  (0, import_react7.useEffect)(() => {
@@ -829,7 +832,7 @@ function ShortcutContext({ children }) {
829
832
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Context.Provider, { value: reveal, children });
830
833
  }
831
834
  function computeDisplayedHotkey(shortcut) {
832
- return shortcut.replace(/(command|cmd)/g, "\u2318").replace(/option/g, "\u2325").replace(/shift/g, "\u21E7").replace(/ctrl/g, "\u2303");
835
+ return shortcut.replace(/meta/g, "\u2318").replace(/option/g, "\u2325").replace(/shift/g, "\u21E7").replace(/ctrl/g, "\u2303");
833
836
  }
834
837
  function ShortcutRevealer({
835
838
  shortcut,
@@ -5280,7 +5283,9 @@ var StatusBullet = ({ status, hideText = false, message, ...props }) => {
5280
5283
  input,
5281
5284
  inputError,
5282
5285
  inputSelect,
5286
+ isMacLike,
5283
5287
  labelText,
5288
+ macifyShortcut,
5284
5289
  mq,
5285
5290
  ripple,
5286
5291
  scrollbarStyles,
@@ -5290,5 +5295,6 @@ var StatusBullet = ({ status, hideText = false, message, ...props }) => {
5290
5295
  useCurrentTab,
5291
5296
  useDrawer,
5292
5297
  useIconContext,
5293
- useMenuContext
5298
+ useMenuContext,
5299
+ useShortcut
5294
5300
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "18.3.1-alpha.22+61a3fbd5a",
3
+ "version": "18.5.0",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@emotion/jest": "11.10.5",
21
- "@storybook/addon-docs": "6.5.15",
22
- "@storybook/react": "6.5.15",
21
+ "@storybook/addon-docs": "6.5.16",
22
+ "@storybook/react": "6.5.16",
23
23
  "@types/react": "18.0.27",
24
24
  "autoprefixer": "10.4.13",
25
25
  "hygen": "6.2.11",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "61a3fbd5aadff46369076445db0ede53fc229d34"
51
+ "gitHead": "757923e90bece28162621d867709e08674bdaa05"
52
52
  }