@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.
- package/dist/css/index.css +3975 -0
- package/dist/hyphen-components.cjs.development.js +158 -0
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +2 -2
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +115 -0
- package/dist/hyphen-components.esm.js.map +1 -1
- package/dist/index.d.ts +109 -3
- package/package.json +2 -2
- package/src/index.ts +2 -0
- package/src/styles/component-modules.js +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { ReactNode, Key, MouseEvent, KeyboardEvent, CSSProperties, FC, ButtonHTMLAttributes, RefObject, ChangeEvent, FocusEvent, HTMLProps, ForwardRefExoticComponent, InputHTMLAttributes, useEffect } from 'react';
|
|
2
|
+
import React__default, { ReactNode, Key, MouseEvent, KeyboardEvent, CSSProperties, FC, ButtonHTMLAttributes, RefObject, ChangeEvent, FocusEvent, HTMLProps, ForwardRefExoticComponent, InputHTMLAttributes, useEffect, AnchorHTMLAttributes } from 'react';
|
|
3
3
|
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
4
|
-
import { BreakpointSize, SpacingSize, WidthSize, HeightSize,
|
|
4
|
+
import { BorderRadiusSize as BorderRadiusSize$1, BreakpointSize, SpacingSize, WidthSize, HeightSize, BackgroundColor, BorderColor, BorderSize, FontColor, FontFamily, FontSize, FontWeight, BoxShadowSize, TextTransform, TextWrap, ZIndexSize, IconName, HeadingSize, ColorName, BaseColor, LineHeightSize } from '@hyphen/hyphen-design-tokens/build/types';
|
|
5
|
+
export { BackgroundColor, BaseColor, BorderColor, BorderSize, BoxShadowSize, BreakpointSize, ColorName, FontColor, FontFamily, FontSize, FontWeight, HeadingSize, HeightSize, IconName, LineHeightSize, SpacingSize, TextDecorationLine, TextDecorationStyle, TextTransform, TextWrap, WhiteSpace, WidthSize, WordBreak, ZIndexSize } from '@hyphen/hyphen-design-tokens/build/types';
|
|
5
6
|
import * as CSS from 'csstype';
|
|
6
7
|
import { DayPickerProps } from 'react-day-picker';
|
|
7
8
|
export { Matcher } from 'react-day-picker';
|
|
@@ -24,8 +25,20 @@ type DimensionSize = WidthSize | HeightSize;
|
|
|
24
25
|
type UnknownPropertiesObjType = {
|
|
25
26
|
[key: string]: any;
|
|
26
27
|
};
|
|
28
|
+
interface FlexProperty {
|
|
29
|
+
flexGrow?: number | string;
|
|
30
|
+
flexShrink?: number | string;
|
|
31
|
+
flexBasis?: number | string;
|
|
32
|
+
flex?: number | string;
|
|
33
|
+
}
|
|
34
|
+
type StylesAndClasses<T> = {
|
|
35
|
+
styles?: T;
|
|
36
|
+
classes?: string[];
|
|
37
|
+
};
|
|
38
|
+
type CssDimensionAbbreviation = 'h' | 'w' | 'mw' | 'mh' | 'minw' | 'minh';
|
|
27
39
|
type CssDimensionUnit = 'px' | 'rem' | 'em' | '%';
|
|
28
40
|
type CssDimensionValue = `${number}${CssDimensionUnit}`;
|
|
41
|
+
type CssSpacingAbbreviation = 'm' | 'p';
|
|
29
42
|
type CssJustifyContentValue = 'space-around' | 'space-between' | 'center' | 'flex-end' | 'space-evenly' | 'flex-start' | 'stretch';
|
|
30
43
|
type CssAlignContentValue = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around';
|
|
31
44
|
type CssFlexDirectionValue = 'column' | 'column-reverse' | 'row' | 'row-reverse' | undefined;
|
|
@@ -2690,4 +2703,97 @@ interface HookWindowSize {
|
|
|
2690
2703
|
}
|
|
2691
2704
|
declare const useWindowSize: () => HookWindowSize;
|
|
2692
2705
|
|
|
2693
|
-
|
|
2706
|
+
declare function isValidSpacingValue(value?: string | ResponsiveProp<string | undefined>): boolean;
|
|
2707
|
+
declare function generateBaseClasses(attribute: string | undefined, value?: string | ResponsiveProp<string | undefined>): string[];
|
|
2708
|
+
declare function cssShorthandToClasses(attribute: string, value?: string | ResponsiveProp<string | undefined>): string[];
|
|
2709
|
+
|
|
2710
|
+
declare function doesStringIncludeCssUnit(value: string | undefined): boolean;
|
|
2711
|
+
|
|
2712
|
+
declare function generateResponsiveClasses(classRoot: string, value: ResponsiveProp<any> | string | undefined): string[];
|
|
2713
|
+
|
|
2714
|
+
declare function getAutoCompleteValue(value: string | boolean): string;
|
|
2715
|
+
|
|
2716
|
+
declare const getColumnKeys: (columns: Column[]) => Key[];
|
|
2717
|
+
|
|
2718
|
+
declare function getDimensionStyles(dimension: CssDimensionAbbreviation, value?: DimensionSize | ResponsiveProp<DimensionSize> | string): {
|
|
2719
|
+
[key: string]: string;
|
|
2720
|
+
} | undefined;
|
|
2721
|
+
declare function getDimensionClasses(dimension: CssDimensionAbbreviation, value?: DimensionSize | ResponsiveProp<DimensionSize> | string): string[] | undefined;
|
|
2722
|
+
/**
|
|
2723
|
+
* Returns an object of styles and class names that correspond with the given value
|
|
2724
|
+
* @param {CssDimensionAbbreviation} dimension width or height
|
|
2725
|
+
* @param {string} [value] value of the dimension
|
|
2726
|
+
*/
|
|
2727
|
+
declare function getDimensionCss(dimension: CssDimensionAbbreviation, value?: DimensionSize | ResponsiveProp<DimensionSize> | string): StylesAndClasses<CSSProperties>;
|
|
2728
|
+
|
|
2729
|
+
/**
|
|
2730
|
+
* Returns a createElement() type based on the props of the Component.
|
|
2731
|
+
* Useful for calculating what type a component should render as.
|
|
2732
|
+
*
|
|
2733
|
+
* @param {function} Component A function or ReactClass.
|
|
2734
|
+
* @param {object} props A ReactElement props object
|
|
2735
|
+
* @param {function} [getDefault] A function that returns a default element type.
|
|
2736
|
+
* @returns {string} A ReactElement type
|
|
2737
|
+
*/
|
|
2738
|
+
declare function getElementType(// eslint-disable-line import/prefer-default-export
|
|
2739
|
+
Component: React__default.Component | React__default.FC, props: {
|
|
2740
|
+
[key: string]: unknown;
|
|
2741
|
+
}, getDefault?: () => string): string;
|
|
2742
|
+
|
|
2743
|
+
declare function parsePropertyValue(value: string): string | number;
|
|
2744
|
+
declare function getFlexStyles(value?: string): FlexProperty | undefined;
|
|
2745
|
+
declare function getFlexClasses(value?: string): string[] | undefined;
|
|
2746
|
+
/**
|
|
2747
|
+
* Returns an object of styles and class names that correspond with the given flex value
|
|
2748
|
+
* @param {string} [value] spacing token value
|
|
2749
|
+
*/
|
|
2750
|
+
declare function getFlexCss(value?: ResponsiveProp<FlexProperty> | string): StylesAndClasses<FlexProperty>;
|
|
2751
|
+
|
|
2752
|
+
declare const isFunction: <TValue, TArg>(// eslint-disable-line import/prefer-default-export
|
|
2753
|
+
valOrFunction: ValueOrFunction<TValue, TArg>) => valOrFunction is ValueFunction<TValue, TArg>;
|
|
2754
|
+
|
|
2755
|
+
declare function mergeRefs<T = unknown>(refs: Array<React__default.MutableRefObject<T> | React__default.LegacyRef<T> | undefined | null>): React__default.RefCallback<T>;
|
|
2756
|
+
|
|
2757
|
+
declare const prefersReducedMotion: () => boolean;
|
|
2758
|
+
|
|
2759
|
+
declare const isModifiedEvent: (e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => boolean;
|
|
2760
|
+
/**
|
|
2761
|
+
* Due to react-router's handling of custom components used in RR <Link>
|
|
2762
|
+
* we must add this validation that ensures the router will execute the passed `navigate`
|
|
2763
|
+
* prop, thus navigating the user without triggering a refresh.
|
|
2764
|
+
*
|
|
2765
|
+
* SOURCES:
|
|
2766
|
+
* https://github.com/ReactTraining/react-router/issues/7727
|
|
2767
|
+
* https://github.com/ReactTraining/react-router/issues/7761
|
|
2768
|
+
* */
|
|
2769
|
+
declare const handleReactRouterClick: (event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>, onClick: ((e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void) | undefined, target: AnchorHTMLAttributes<HTMLAnchorElement>["target"] | undefined, navigate: (() => void) | undefined) => void;
|
|
2770
|
+
|
|
2771
|
+
declare const resolveValue: <TValue, TArg>(// eslint-disable-line import/prefer-default-export
|
|
2772
|
+
valOrFunction: ValueOrFunction<TValue, TArg>, arg: TArg) => TValue;
|
|
2773
|
+
|
|
2774
|
+
type FilterFunction = (child: ReactNode, index?: number, children?: ReactNode[]) => boolean;
|
|
2775
|
+
declare const filter: (children: ReactNode, filterFn: FilterFunction) => ReactNode[];
|
|
2776
|
+
|
|
2777
|
+
declare const ICON_NAMES: IconName[];
|
|
2778
|
+
declare const BORDER_RADIUS_OPTIONS: BorderRadiusSize[];
|
|
2779
|
+
declare const BORDER_SIZE_OPTIONS: BorderSize[];
|
|
2780
|
+
declare const BREAKPOINT_OPTIONS: BreakpointSizeWithBase[];
|
|
2781
|
+
declare const BREAKPOINTS: Breakpoint[];
|
|
2782
|
+
declare const BASE_COLOR_OPTIONS: BaseColor[];
|
|
2783
|
+
declare const BASE_COLOR_NAMES: ColorName[];
|
|
2784
|
+
declare const FONT_COLOR_OPTIONS: FontColor[];
|
|
2785
|
+
declare const BACKGROUND_COLOR_OPTIONS: BackgroundColor[];
|
|
2786
|
+
declare const BORDER_COLOR_OPTIONS: BorderColor[];
|
|
2787
|
+
declare const FONT_SIZE_OPTIONS: FontSize[];
|
|
2788
|
+
declare const FONT_FAMILY_OPTIONS: FontFamily[];
|
|
2789
|
+
declare const FONT_WEIGHT_OPTIONS: FontWeight[];
|
|
2790
|
+
declare const HEADING_SIZE_OPTIONS: HeadingSize[];
|
|
2791
|
+
declare const HEIGHT_OPTIONS: HeightSize[];
|
|
2792
|
+
declare const LINE_HEIGHT_OPTIONS: LineHeightSize[];
|
|
2793
|
+
declare const SPACING_OPTIONS: SpacingSize[];
|
|
2794
|
+
declare const WIDTH_OPTIONS: WidthSize[];
|
|
2795
|
+
declare const Z_INDEX_OPTIONS: ZIndexSize[];
|
|
2796
|
+
declare const Z_INDEX_VALUES: any;
|
|
2797
|
+
declare const BOX_SHADOW_OPTIONS: BoxShadowSize[];
|
|
2798
|
+
|
|
2799
|
+
export { Alert, type AlertProps, AspectRatio, BACKGROUND_COLOR_OPTIONS, BASE_COLOR_NAMES, BASE_COLOR_OPTIONS, BORDER_COLOR_OPTIONS, BORDER_RADIUS_OPTIONS, BORDER_SIZE_OPTIONS, BOX_SHADOW_OPTIONS, BREAKPOINTS, BREAKPOINT_OPTIONS, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, type BaseButtonProps, type BaseSpacing, type BorderRadiusSize, Box, type BoxProps, type Breakpoint, type BreakpointSizeWithBase, type BreakpointState, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, CardBaseComponent, type CardProps, type CardStatic, type CardWithStaticComponents, type Cell, Checkbox, CheckboxInput, type CheckboxInputProps, type CheckboxProps, type CheckboxSize, Collapsible, CollapsibleContent, CollapsibleTrigger, type Column, type CssAlignContentValue, type CssAlignItemsValue, type CssDimensionAbbreviation, type CssDimensionUnit, type CssDimensionValue, type CssDisplayValue, type CssFlexDirectionValue, type CssFlexValue, type CssJustifyContentValue, type CssOverflowValue, type CssSpacingAbbreviation, type CssTextAlignValue, type CssWhiteSpaceValue, type CssWordBreakValue, Details, DetailsBaseComponent, type DetailsProps, type DetailsStatic, DetailsSummary, type DetailsSummaryProps, type DetailsWithStaticComponents, type DimensionSize, Drawer, DrawerCloseButton, DrawerContent, DrawerHeader, type DrawerPlacementType, type DrawerProps, DrawerProvider, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type EventWithColumnKey, type ExtendedToastOptions, FONT_COLOR_OPTIONS, FONT_FAMILY_OPTIONS, FONT_SIZE_OPTIONS, FONT_WEIGHT_OPTIONS, type FilterFunction, type FlexProperty, FormControl, type FormControlProps, FormLabel, type FormLabelProps, FormikCheckboxInput, type FormikCheckboxInputProps, FormikRadioGroup, type FormikRadioGroupProps, FormikSelectInput, FormikSelectInputInset, type FormikSelectInputInsetProps, FormikSelectInputNative, type FormikSelectInputNativeProps, type FormikSelectInputProps, FormikSwitch, type FormikSwitchProps, FormikTextInput, FormikTextInputInset, type FormikTextInputInsetProps, type FormikTextInputProps, FormikTextareaInput, FormikTextareaInputInset, type FormikTextareaInputInsetProps, type FormikTextareaInputProps, FormikTimePicker, FormikTimePickerNative, type FormikTimePickerNativeProps, type FormikTimePickerProps, FormikToggleGroup, FormikToggleGroupMulti, type FormikToggleGroupMultiProps, type FormikToggleGroupProps, HEADING_SIZE_OPTIONS, HEIGHT_OPTIONS, Heading, type HeadingProps, type HookWindowSize, type HoverableBoxProperties, ICON_NAMES, Icon, type IconProps, type InputRangeProps, LINE_HEIGHT_OPTIONS, Modal, ModalBaseComponent, type ModalProps, type ModalStatic, type ModalWithStaticComponents, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, PopoverPortal, PopoverTrigger, RadioGroup, type RadioGroupProps, RangeInput, ResponsiveContext, type ResponsiveContextShape, type ResponsiveProp, ResponsiveProvider, type ResponsiveProviderProps, type Row, SPACING_OPTIONS, SelectInput, SelectInputInset, type SelectInputInsetProps, type SelectInputInsetSize, SelectInputNative, type SelectInputNativeOption, type SelectInputNativeProps, type SelectInputNativeSize, type SelectInputOptions, type SelectInputProps, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, type SimulatedEventPayloadType, Spinner, type SpinnerProps, type StylesAndClasses, Switch, type SwitchProps, type SwitchSize, Table, type TableProps, TextInput, TextInputInset, type TextInputInsetProps, type TextInputInsetSize, type TextInputProps, type TextInputSize, type TextInputSizeType, TextareaInput, TextareaInputInset, type TextareaInputInsetProps, type TextareaInputInsetSize, type TextareaInputProps, type TextareaInputSize, type Theme, ThemeProvider, ThemeProviderContext, TimePicker, TimePickerNative, type TimePickerNativeProps, type TimePickerProps, type Toast, ToastContainer, type ToastContainerProps, type ToastOptions, type ToastPosition, type ToastType, Toggle, ToggleGroup, ToggleGroupItem, type ToggleVariant$1 as ToggleVariant, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, type UnknownPropertiesObjType, type UseOpenCloseProps, type UseOpenCloseState, type ValueFunction, type ValueOrFunction, WIDTH_OPTIONS, Z_INDEX_OPTIONS, Z_INDEX_VALUES, boxPropsKeys, createRectRef, cssShorthandToClasses, doesStringIncludeCssUnit, filter, generateBaseClasses, generateResponsiveClasses, getAutoCompleteValue, getColumnKeys, getDimensionClasses, getDimensionCss, getDimensionStyles, getElementType, getFlexClasses, getFlexCss, getFlexStyles, handleReactRouterClick, isFunction, isModifiedEvent, isValidSpacingValue, mergeRefs, parsePropertyValue, prefersReducedMotion, resolveValue, toast, useBreakpoint, useDrawer, useIsMobile, useIsomorphicLayoutEffect, useOpenClose, useSidebar, useTheme, useToasts, useWindowSize };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyphen/hyphen-components",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "@hyphen"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"src"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "cross-env IS_PUBLISHING=true tsup &&
|
|
17
|
+
"build": "cross-env IS_PUBLISHING=true tsup && cross-env IS_PUBLISHING=true webpack --config webpack.config.js && node scripts/create-cjs-shim.js",
|
|
18
18
|
"build-storybook": "storybook build",
|
|
19
19
|
"build-storybook-docs": "storybook build --docs",
|
|
20
20
|
"storybook-docs": "storybook dev --docs",
|
package/src/index.ts
CHANGED