@hyphen/hyphen-components 7.3.3 → 7.3.5

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.
@@ -2538,9 +2538,65 @@ var getColumnKeys = (columns) => {
2538
2538
  return columnKeys;
2539
2539
  };
2540
2540
 
2541
+ // src/lib/getFlexCss.ts
2542
+ var flexValues = ["initial", "auto", "unset", "none", "inherit"];
2543
+ function parsePropertyValue(value) {
2544
+ return Number.isNaN(Number(value)) ? value : Number(value);
2545
+ }
2546
+ function getFlexStyles(value) {
2547
+ if (value === void 0) return value;
2548
+ const styles37 = {};
2549
+ if (!value.includes(" ") && !flexValues.includes(value)) {
2550
+ styles37.flex = value;
2551
+ return styles37;
2552
+ }
2553
+ if (value.includes(" ")) {
2554
+ const flexProps = value.split(" ");
2555
+ styles37.flexGrow = parsePropertyValue(flexProps[0]);
2556
+ if (flexProps.length === 2) {
2557
+ if (doesStringIncludeCssUnit(flexProps[1])) {
2558
+ styles37.flexBasis = parsePropertyValue(flexProps[1]);
2559
+ } else {
2560
+ styles37.flexShrink = parsePropertyValue(flexProps[1]);
2561
+ }
2562
+ } else if (flexProps.length === 3) {
2563
+ styles37.flexShrink = parsePropertyValue(flexProps[1]);
2564
+ styles37.flexBasis = parsePropertyValue(flexProps[2]);
2565
+ }
2566
+ }
2567
+ return styles37;
2568
+ }
2569
+ function getFlexClasses(value) {
2570
+ if (value === void 0 || value.split(" ").length > 1) return [];
2571
+ const classes = [];
2572
+ if (typeof value === "string" && !doesStringIncludeCssUnit(value) && Number.isNaN(Number(value))) {
2573
+ classes.push(`flex-${value}`);
2574
+ }
2575
+ return classes;
2576
+ }
2577
+ function getFlexCss(value) {
2578
+ return {
2579
+ styles: getFlexStyles(value),
2580
+ classes: getFlexClasses(value)
2581
+ };
2582
+ }
2583
+
2541
2584
  // src/lib/isFunction.ts
2542
2585
  var isFunction = (valOrFunction) => typeof valOrFunction === "function";
2543
2586
 
2587
+ // src/lib/mergeRefs.ts
2588
+ function mergeRefs(refs) {
2589
+ return (value) => {
2590
+ refs.forEach((ref) => {
2591
+ if (typeof ref === "function") {
2592
+ ref(value);
2593
+ } else if (ref != null) {
2594
+ ref.current = value;
2595
+ }
2596
+ });
2597
+ };
2598
+ }
2599
+
2544
2600
  // src/lib/prefersReducedMotion.ts
2545
2601
  var prefersReducedMotion = /* @__PURE__ */ (() => {
2546
2602
  let shouldReduceMotion;
@@ -2553,15 +2609,31 @@ var prefersReducedMotion = /* @__PURE__ */ (() => {
2553
2609
  };
2554
2610
  })();
2555
2611
 
2612
+ // src/lib/reactRouterClickHandler.ts
2613
+ var isModifiedEvent = (e) => !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
2614
+ var handleReactRouterClick = (event, onClick, target, navigate) => {
2615
+ if (onClick) onClick(event);
2616
+ if (!event.defaultPrevented && // onClick prevented default
2617
+ event.button === 0 && // ignore everything but left clicks
2618
+ (!target || target === "_self") && // let browser handle "target=_blank" etc.
2619
+ !isModifiedEvent(event) && // ignore clicks with modifier keys
2620
+ navigate) {
2621
+ event.preventDefault();
2622
+ navigate();
2623
+ }
2624
+ };
2625
+
2556
2626
  // src/lib/resolveValue.ts
2557
2627
  var resolveValue = (valOrFunction, arg) => isFunction(valOrFunction) ? valOrFunction(arg) : valOrFunction;
2558
2628
 
2559
2629
  // src/lib/react-children-utilities/filter.ts
2560
2630
  import { Children as Children2 } from "react";
2631
+ var filter = (children, filterFn) => Children2.toArray(children).filter(filterFn);
2561
2632
 
2562
2633
  // src/lib/tokens.ts
2563
2634
  import designTokens from "@hyphen/hyphen-design-tokens/build/json/variables";
2564
2635
  import { ICON_NAMES as iconNames } from "@hyphen/hyphen-design-tokens/build/assets/icons";
2636
+ var ICON_NAMES = iconNames;
2565
2637
  var BORDER_RADIUS_OPTIONS = Object.keys(
2566
2638
  designTokens.size["border-radius"]
2567
2639
  );
@@ -6159,6 +6231,15 @@ var useTheme = () => {
6159
6231
  export {
6160
6232
  Alert,
6161
6233
  AspectRatio,
6234
+ BACKGROUND_COLOR_OPTIONS,
6235
+ BASE_COLOR_NAMES,
6236
+ BASE_COLOR_OPTIONS,
6237
+ BORDER_COLOR_OPTIONS,
6238
+ BORDER_RADIUS_OPTIONS,
6239
+ BORDER_SIZE_OPTIONS,
6240
+ BOX_SHADOW_OPTIONS,
6241
+ BREAKPOINTS,
6242
+ BREAKPOINT_OPTIONS,
6162
6243
  Badge,
6163
6244
  Box,
6164
6245
  Button,
@@ -6193,6 +6274,10 @@ export {
6193
6274
  DropdownMenuSubContent,
6194
6275
  DropdownMenuSubTrigger,
6195
6276
  DropdownMenuTrigger,
6277
+ FONT_COLOR_OPTIONS,
6278
+ FONT_FAMILY_OPTIONS,
6279
+ FONT_SIZE_OPTIONS,
6280
+ FONT_WEIGHT_OPTIONS,
6196
6281
  FormControl,
6197
6282
  FormLabel,
6198
6283
  FormikCheckboxInput,
@@ -6209,8 +6294,12 @@ export {
6209
6294
  FormikTimePickerNative,
6210
6295
  FormikToggleGroup,
6211
6296
  FormikToggleGroupMulti,
6297
+ HEADING_SIZE_OPTIONS,
6298
+ HEIGHT_OPTIONS,
6212
6299
  Heading,
6300
+ ICON_NAMES,
6213
6301
  Icon,
6302
+ LINE_HEIGHT_OPTIONS,
6214
6303
  Modal,
6215
6304
  ModalBaseComponent,
6216
6305
  Pagination,
@@ -6223,6 +6312,7 @@ export {
6223
6312
  RangeInput,
6224
6313
  ResponsiveContext,
6225
6314
  ResponsiveProvider,
6315
+ SPACING_OPTIONS,
6226
6316
  SelectInput,
6227
6317
  SelectInputInset,
6228
6318
  SelectInputNative,
@@ -6264,8 +6354,33 @@ export {
6264
6354
  TooltipPortal,
6265
6355
  TooltipProvider,
6266
6356
  TooltipTrigger,
6357
+ WIDTH_OPTIONS,
6358
+ Z_INDEX_OPTIONS,
6359
+ Z_INDEX_VALUES,
6267
6360
  boxPropsKeys,
6268
6361
  createRectRef,
6362
+ cssShorthandToClasses,
6363
+ doesStringIncludeCssUnit,
6364
+ filter,
6365
+ generateBaseClasses,
6366
+ generateResponsiveClasses,
6367
+ getAutoCompleteValue,
6368
+ getColumnKeys,
6369
+ getDimensionClasses,
6370
+ getDimensionCss,
6371
+ getDimensionStyles,
6372
+ getElementType,
6373
+ getFlexClasses,
6374
+ getFlexCss,
6375
+ getFlexStyles,
6376
+ handleReactRouterClick,
6377
+ isFunction,
6378
+ isModifiedEvent,
6379
+ isValidSpacingValue,
6380
+ mergeRefs,
6381
+ parsePropertyValue,
6382
+ prefersReducedMotion,
6383
+ resolveValue,
6269
6384
  toast,
6270
6385
  useBreakpoint,
6271
6386
  useDrawer,