@edvisor/product-language 0.11.112 → 0.11.113
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/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +1 -1
- package/lib/components/alert-banner/alert-banner.d.ts +18 -18
- package/lib/components/alert-banner/alert-level-flags.d.ts +18 -18
- package/lib/components/alert-banner/index.d.ts +1 -1
- package/lib/components/autocomplete-input/autocomplete-input.d.ts +39 -39
- package/lib/components/autocomplete-input/index.d.ts +1 -1
- package/lib/components/badge/badge-type-flags.d.ts +18 -18
- package/lib/components/badge/badge.d.ts +7 -7
- package/lib/components/badge/index.d.ts +1 -1
- package/lib/components/card/atoms/card-frame.d.ts +7 -7
- package/lib/components/card/atoms/index.d.ts +1 -1
- package/lib/components/card/card.d.ts +14 -14
- package/lib/components/card/components/card-alert-banner-slot.d.ts +5 -6
- package/lib/components/card/components/card-controls-slot.d.ts +4 -5
- package/lib/components/card/components/card-section-slot.d.ts +11 -11
- package/lib/components/card/components/index.d.ts +3 -3
- package/lib/components/card/index.d.ts +3 -3
- package/lib/components/card/molecules/index.d.ts +1 -1
- package/lib/components/card/molecules/left-right-card.d.ts +16 -16
- package/lib/components/checkbox/checkbox.d.ts +11 -11
- package/lib/components/checkbox/helpers.d.ts +12 -12
- package/lib/components/checkbox/index.d.ts +1 -1
- package/lib/components/date-picker/components/custom-calendar.d.ts +6 -6
- package/lib/components/date-picker/components/index.d.ts +1 -1
- package/lib/components/date-picker/date-picker-utc.d.ts +9 -9
- package/lib/components/date-picker/date-picker.d.ts +19 -19
- package/lib/components/date-picker/helpers/date-picker-factory.d.ts +38 -38
- package/lib/components/date-picker/index.d.ts +2 -2
- package/lib/components/divider/divider-type-flags.d.ts +9 -9
- package/lib/components/divider/divider.d.ts +7 -7
- package/lib/components/divider/index.d.ts +1 -1
- package/lib/components/flag/flag-size-flags.d.ts +22 -22
- package/lib/components/flag/flag.d.ts +4 -4
- package/lib/components/flag/helpers/flag-sprite-sheet.d.ts +5 -5
- package/lib/components/flag/helpers/index.d.ts +1 -1
- package/lib/components/flag/index.d.ts +1 -1
- package/lib/components/flag/types.d.ts +5 -5
- package/lib/components/icon/icon-list.d.ts +149 -150
- package/lib/components/icon/icon.d.ts +149 -149
- package/lib/components/icon/index.d.ts +1 -1
- package/lib/components/index.d.ts +39 -39
- package/lib/components/inline-error/index.d.ts +1 -1
- package/lib/components/inline-error/inline-error.d.ts +7 -7
- package/lib/components/input-field/components/index.d.ts +2 -2
- package/lib/components/input-field/components/labeled-input.d.ts +11 -11
- package/lib/components/input-field/components/stepper.d.ts +7 -7
- package/lib/components/input-field/index.d.ts +4 -4
- package/lib/components/input-field/input-currency.d.ts +23 -22
- package/lib/components/input-field/input-currency.helpers.d.ts +32 -0
- package/lib/components/input-field/input-field.d.ts +27 -27
- package/lib/components/input-field/input-number.d.ts +19 -19
- package/lib/components/input-field/input-text.d.ts +14 -14
- package/lib/components/layout/flex.d.ts +16 -16
- package/lib/components/layout/grid-layout.d.ts +11 -11
- package/lib/components/layout/index.d.ts +3 -3
- package/lib/components/layout/left-right-layout.d.ts +33 -34
- package/lib/components/link/index.d.ts +1 -1
- package/lib/components/link/link.d.ts +14 -14
- package/lib/components/markdown/index.d.ts +1 -1
- package/lib/components/markdown/markdown.d.ts +7 -7
- package/lib/components/menu/index.d.ts +1 -1
- package/lib/components/menu/menu.d.ts +18 -18
- package/lib/components/modal/index.d.ts +3 -3
- package/lib/components/modal/modal-base.d.ts +32 -32
- package/lib/components/modal/modal-destructive.d.ts +16 -16
- package/lib/components/modal/modal.d.ts +16 -16
- package/lib/components/molecules/avatar/avatar-size-flags.d.ts +11 -12
- package/lib/components/molecules/avatar/avatar.d.ts +12 -12
- package/lib/components/molecules/avatar/index.d.ts +1 -1
- package/lib/components/molecules/button/button-flags.d.ts +44 -44
- package/lib/components/molecules/button/button.d.ts +12 -12
- package/lib/components/molecules/button/index.d.ts +1 -1
- package/lib/components/molecules/index.d.ts +4 -4
- package/lib/components/molecules/input-checkbox/index.d.ts +1 -1
- package/lib/components/molecules/input-checkbox/input-checkbox.d.ts +8 -8
- package/lib/components/molecules/simple-menu/SimpleMenu.d.ts +14 -15
- package/lib/components/molecules/simple-menu/index.d.ts +1 -1
- package/lib/components/organisms/choice-list/choice-list.d.ts +9 -9
- package/lib/components/organisms/choice-list/index.d.ts +1 -1
- package/lib/components/organisms/index.d.ts +2 -2
- package/lib/components/organisms/multi-choice-list/index.d.ts +1 -1
- package/lib/components/organisms/multi-choice-list/multi-choice-list.d.ts +11 -11
- package/lib/components/page-header/index.d.ts +1 -1
- package/lib/components/page-header/page-header.d.ts +25 -26
- package/lib/components/pagination/index.d.ts +1 -1
- package/lib/components/pagination/pagination.d.ts +10 -10
- package/lib/components/progress-bar/index.d.ts +1 -1
- package/lib/components/progress-bar/progress-bar-size-flags.d.ts +10 -10
- package/lib/components/progress-bar/progress-bar.d.ts +8 -8
- package/lib/components/radio-button/index.d.ts +1 -1
- package/lib/components/radio-button/radio-button.d.ts +11 -11
- package/lib/components/range-slider/components/bar-chart.d.ts +8 -8
- package/lib/components/range-slider/components/handle.d.ts +12 -12
- package/lib/components/range-slider/components/rail.d.ts +9 -9
- package/lib/components/range-slider/components/slider-component.d.ts +12 -12
- package/lib/components/range-slider/components/slider-inputs.d.ts +15 -16
- package/lib/components/range-slider/components/tick.d.ts +10 -10
- package/lib/components/range-slider/components/track.d.ts +11 -11
- package/lib/components/range-slider/index.d.ts +2 -2
- package/lib/components/range-slider/range-slider.d.ts +16 -16
- package/lib/components/range-slider/slider.d.ts +12 -12
- package/lib/components/range-slider/types.d.ts +11 -11
- package/lib/components/react-select/index.d.ts +1 -1
- package/lib/components/react-select/react-select.d.ts +14 -15
- package/lib/components/select/components/helpers.d.ts +17 -17
- package/lib/components/select/components/menu-container.d.ts +3 -3
- package/lib/components/select/components/menu-list-expanded.d.ts +6 -6
- package/lib/components/select/components/menu-list.d.ts +3 -3
- package/lib/components/select/components/menu-row.d.ts +11 -11
- package/lib/components/select/components/menu.d.ts +2 -3
- package/lib/components/select/components/option.d.ts +2 -3
- package/lib/components/select/components/optionMultiLevel.d.ts +2 -3
- package/lib/components/select/components/optionMultilevelExpanded.d.ts +5 -5
- package/lib/components/select/components/select-label.d.ts +1 -1
- package/lib/components/select/components/value-component-multi.d.ts +4 -4
- package/lib/components/select/components/value-component-single.d.ts +5 -4
- package/lib/components/select/components/value.d.ts +5 -4
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.d.ts +7 -10
- package/lib/components/select/types.d.ts +300 -300
- package/lib/components/select/utils.d.ts +16 -16
- package/lib/components/select-with-groups/index.d.ts +2 -2
- package/lib/components/select-with-groups/select-with-groups.d.ts +35 -35
- package/lib/components/spinner/index.d.ts +1 -1
- package/lib/components/spinner/spinner-size-flags.d.ts +10 -10
- package/lib/components/spinner/spinner.d.ts +9 -9
- package/lib/components/stepper/index.d.ts +1 -1
- package/lib/components/stepper/stepper.d.ts +9 -9
- package/lib/components/switch/index.d.ts +1 -1
- package/lib/components/switch/switch.d.ts +13 -13
- package/lib/components/table/hooks/index.d.ts +4 -4
- package/lib/components/table/hooks/useFilteredRows.d.ts +5 -5
- package/lib/components/table/hooks/usePaginatedRows.d.ts +12 -12
- package/lib/components/table/hooks/useSortedRows.d.ts +6 -6
- package/lib/components/table/hooks/useTable.d.ts +47 -47
- package/lib/components/table/index.d.ts +2 -2
- package/lib/components/table/table.d.ts +28 -28
- package/lib/components/tabs/components/index.d.ts +1 -1
- package/lib/components/tabs/components/tab.d.ts +10 -10
- package/lib/components/tabs/index.d.ts +1 -1
- package/lib/components/tabs/tabs.d.ts +18 -18
- package/lib/components/tag/components/close-button.d.ts +8 -8
- package/lib/components/tag/components/index.d.ts +2 -2
- package/lib/components/tag/components/tag-label.d.ts +8 -8
- package/lib/components/tag/index.d.ts +1 -1
- package/lib/components/tag/tag.d.ts +10 -10
- package/lib/components/text-area/index.d.ts +1 -1
- package/lib/components/text-area/text-area.d.ts +11 -11
- package/lib/components/text-toggle/index.d.ts +1 -1
- package/lib/components/text-toggle/text-toggle.d.ts +10 -10
- package/lib/components/thumbnail/index.d.ts +1 -1
- package/lib/components/thumbnail/thumbnail-size-flags.d.ts +10 -10
- package/lib/components/thumbnail/thumbnail.d.ts +10 -10
- package/lib/components/toast/index.d.ts +1 -1
- package/lib/components/toast/toast.d.ts +17 -17
- package/lib/components/tooltip/index.d.ts +1 -1
- package/lib/components/tooltip/tooltip.d.ts +30 -30
- package/lib/components/tree-view/components/tree-node.d.ts +3 -3
- package/lib/components/tree-view/helper.d.ts +12 -12
- package/lib/components/tree-view/index.d.ts +2 -2
- package/lib/components/tree-view/tree-view.d.ts +3 -3
- package/lib/components/tree-view/types.d.ts +63 -63
- package/lib/components/typography/index.d.ts +1 -1
- package/lib/components/typography/typography.d.ts +27 -27
- package/lib/foundations/color-system/base-palette/base-palette.d.ts +76 -76
- package/lib/foundations/color-system/base-palette/index.d.ts +1 -1
- package/lib/foundations/color-system/color-guidelines/color-guidelines.d.ts +133 -133
- package/lib/foundations/color-system/color-guidelines/index.d.ts +1 -1
- package/lib/foundations/color-system/components/color-sample.d.ts +17 -17
- package/lib/foundations/color-system/components/index.d.ts +1 -1
- package/lib/foundations/color-system/index.d.ts +2 -2
- package/lib/foundations/index.d.ts +4 -4
- package/lib/foundations/shadows/components.d.ts +8 -8
- package/lib/foundations/shadows/index.d.ts +1 -1
- package/lib/foundations/shadows/shadows.d.ts +8 -8
- package/lib/foundations/spacing/index.d.ts +1 -1
- package/lib/foundations/spacing/spacing-guidelines.d.ts +37 -37
- package/lib/foundations/spacing/spacing.d.ts +19 -19
- package/lib/foundations/typography/constants.d.ts +39 -39
- package/lib/foundations/typography/fonts.d.ts +1 -1
- package/lib/foundations/typography/index.d.ts +2 -2
- package/lib/foundations/typography/text-aspect-flags.d.ts +30 -30
- package/lib/foundations/typography/typography.d.ts +24 -24
- package/lib/helpers/generic-types.d.ts +21 -21
- package/lib/helpers/index.d.ts +10 -10
- package/lib/helpers/isReactElementOfType.d.ts +6 -8
- package/lib/helpers/nothing.d.ts +9 -10
- package/lib/helpers/numbers.d.ts +51 -51
- package/lib/helpers/safe-navigation.d.ts +26 -26
- package/lib/helpers/slots.d.ts +17 -17
- package/lib/helpers/strings.d.ts +1 -1
- package/lib/helpers/useClickOutside.d.ts +2 -2
- package/lib/helpers/useInputElementState.d.ts +30 -30
- package/lib/helpers/useIsMobile.d.ts +1 -1
- package/lib/helpers/useKeyDown.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { MappedEnum, PropsWithChildren, RequireOnlyOne } from '@helpers';
|
|
2
|
-
export declare const enum TextAspects {
|
|
3
|
-
default = 1,
|
|
4
|
-
subdued = 2,
|
|
5
|
-
light = 4,
|
|
6
|
-
critical = 8,
|
|
7
|
-
success = 16,
|
|
8
|
-
onPrimary = 32,
|
|
9
|
-
onCritical = 64
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export declare const TextAspectColors: {
|
|
13
|
-
1: "#1F2937";
|
|
14
|
-
2: "#6B7280";
|
|
15
|
-
4: "#9CA3AF";
|
|
16
|
-
32: "#FFFFFF";
|
|
17
|
-
64: "#FFFFFF";
|
|
18
|
-
16: "#059669";
|
|
19
|
-
8: "#DC2626";
|
|
20
|
-
};
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
$onCritical?: boolean;
|
|
24
|
-
$onPrimary?: boolean;
|
|
25
|
-
};
|
|
26
|
-
export
|
|
27
|
-
$underlined?: boolean;
|
|
28
|
-
} & PropsWithChildren;
|
|
29
|
-
export declare function getTextAspect(props: ITextAspectProps & ITransientTextAspectProps): "#9CA3AF" | "#6B7280" | "#1F2937" | "#DC2626" | "#059669" | "#FFFFFF";
|
|
30
|
-
export {};
|
|
1
|
+
import { MappedEnum, PropsWithChildren, RequireOnlyOne } from '@helpers';
|
|
2
|
+
export declare const enum TextAspects {
|
|
3
|
+
default = 1,
|
|
4
|
+
subdued = 2,
|
|
5
|
+
light = 4,
|
|
6
|
+
critical = 8,
|
|
7
|
+
success = 16,
|
|
8
|
+
onPrimary = 32,
|
|
9
|
+
onCritical = 64
|
|
10
|
+
}
|
|
11
|
+
type TextOptions<T> = MappedEnum<typeof TextAspects, T>;
|
|
12
|
+
export declare const TextAspectColors: {
|
|
13
|
+
1: "#1F2937";
|
|
14
|
+
2: "#6B7280";
|
|
15
|
+
4: "#9CA3AF";
|
|
16
|
+
32: "#FFFFFF";
|
|
17
|
+
64: "#FFFFFF";
|
|
18
|
+
16: "#059669";
|
|
19
|
+
8: "#DC2626";
|
|
20
|
+
};
|
|
21
|
+
export type ITextAspectProps = Partial<RequireOnlyOne<TextOptions<boolean>>> & PropsWithChildren;
|
|
22
|
+
export type TransientTextOptions = Omit<TextOptions<boolean>, 'onCritical' | 'onPrimary'> & {
|
|
23
|
+
$onCritical?: boolean;
|
|
24
|
+
$onPrimary?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type ITransientTextAspectProps = Partial<RequireOnlyOne<TransientTextOptions>> & {
|
|
27
|
+
$underlined?: boolean;
|
|
28
|
+
} & PropsWithChildren;
|
|
29
|
+
export declare function getTextAspect(props: ITextAspectProps & ITransientTextAspectProps): "#9CA3AF" | "#6B7280" | "#1F2937" | "#DC2626" | "#059669" | "#FFFFFF";
|
|
30
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ITransientTextAspectProps } from './text-aspect-flags';
|
|
2
|
-
export
|
|
3
|
-
default?: boolean;
|
|
4
|
-
subtle?: boolean;
|
|
5
|
-
strong?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export
|
|
8
|
-
default?: boolean;
|
|
9
|
-
strong?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const Typography: {
|
|
12
|
-
Display: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
13
|
-
Heading1: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
14
|
-
Heading2: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
15
|
-
Heading3: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
16
|
-
Heading4: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
17
|
-
Body: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<IBodyProps, any>>;
|
|
18
|
-
BodyLarge: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<IBodyProps, any>>;
|
|
19
|
-
Caption: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
20
|
-
Label: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ILabelProps, any>>;
|
|
21
|
-
};
|
|
22
|
-
export declare const _Typography: {
|
|
23
|
-
LightText: import("styled-components").FlattenSimpleInterpolation;
|
|
24
|
-
};
|
|
1
|
+
import { ITransientTextAspectProps } from './text-aspect-flags';
|
|
2
|
+
export type ILabelProps = ITransientTextAspectProps & {
|
|
3
|
+
default?: boolean;
|
|
4
|
+
subtle?: boolean;
|
|
5
|
+
strong?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type IBodyProps = ITransientTextAspectProps & {
|
|
8
|
+
default?: boolean;
|
|
9
|
+
strong?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const Typography: {
|
|
12
|
+
Display: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
13
|
+
Heading1: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
14
|
+
Heading2: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
15
|
+
Heading3: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
16
|
+
Heading4: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
17
|
+
Body: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<IBodyProps, any>>;
|
|
18
|
+
BodyLarge: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<IBodyProps, any>>;
|
|
19
|
+
Caption: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ITransientTextAspectProps, any>>;
|
|
20
|
+
Label: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<ILabelProps, any>>;
|
|
21
|
+
};
|
|
22
|
+
export declare const _Typography: {
|
|
23
|
+
LightText: import("styled-components").FlattenSimpleInterpolation;
|
|
24
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { FC as FunctionComponent, ForwardRefExoticComponent, ForwardRefRenderFunction, PropsWithChildren as PWC, PropsWithoutRef, RefAttributes } from 'react';
|
|
2
|
-
import { Slot } from './slots';
|
|
3
|
-
/** @see https://stackoverflow.com/a/49725198/29182 */
|
|
4
|
-
export
|
|
5
|
-
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
|
|
6
|
-
}[Keys];
|
|
7
|
-
export
|
|
8
|
-
[key in keyof E]: T;
|
|
9
|
-
};
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
[x: symbol]: FunctionComponent<PropsWithChildren> | typeof Slot;
|
|
14
|
-
} = {}> = FunctionComponent<P> & {
|
|
15
|
-
[key in keyof E]: E[key];
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
[key in keyof E]: E[key];
|
|
19
|
-
};
|
|
20
|
-
export declare function forwardRef<T, P = {}, E = {}>(render: ForwardRefRenderFunction<T, P>): ExtensibleForwardRef<T, P, E>;
|
|
21
|
-
export {};
|
|
1
|
+
import { FC as FunctionComponent, ForwardRefExoticComponent, ForwardRefRenderFunction, PropsWithChildren as PWC, PropsWithoutRef, RefAttributes } from 'react';
|
|
2
|
+
import { Slot } from './slots';
|
|
3
|
+
/** @see https://stackoverflow.com/a/49725198/29182 */
|
|
4
|
+
export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
5
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
|
|
6
|
+
}[Keys];
|
|
7
|
+
export type MappedEnum<E, T> = {
|
|
8
|
+
[key in keyof E]: T;
|
|
9
|
+
};
|
|
10
|
+
export type Values<T> = T[keyof T];
|
|
11
|
+
export type PropsWithChildren<T = unknown> = PWC<T>;
|
|
12
|
+
export type FC<P = {}, E extends {
|
|
13
|
+
[x: symbol]: FunctionComponent<PropsWithChildren> | typeof Slot;
|
|
14
|
+
} = {}> = FunctionComponent<P> & {
|
|
15
|
+
[key in keyof E]: E[key];
|
|
16
|
+
};
|
|
17
|
+
type ExtensibleForwardRef<T, P = {}, E = {}> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>> & {
|
|
18
|
+
[key in keyof E]: E[key];
|
|
19
|
+
};
|
|
20
|
+
export declare function forwardRef<T, P = {}, E = {}>(render: ForwardRefRenderFunction<T, P>): ExtensibleForwardRef<T, P, E>;
|
|
21
|
+
export {};
|
package/lib/helpers/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from './safe-navigation';
|
|
2
|
-
export * from './slots';
|
|
3
|
-
export * from './generic-types';
|
|
4
|
-
export * from './numbers';
|
|
5
|
-
export * from './nothing';
|
|
6
|
-
export * from './strings';
|
|
7
|
-
export * from './isReactElementOfType';
|
|
8
|
-
export * from './useInputElementState';
|
|
9
|
-
export * from './useIsMobile';
|
|
10
|
-
export * from './useClickOutside';
|
|
1
|
+
export * from './safe-navigation';
|
|
2
|
+
export * from './slots';
|
|
3
|
+
export * from './generic-types';
|
|
4
|
+
export * from './numbers';
|
|
5
|
+
export * from './nothing';
|
|
6
|
+
export * from './strings';
|
|
7
|
+
export * from './isReactElementOfType';
|
|
8
|
+
export * from './useInputElementState';
|
|
9
|
+
export * from './useIsMobile';
|
|
10
|
+
export * from './useClickOutside';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { PureComponent, ReactElement } from 'react';
|
|
2
|
-
import { StyledComponent } from 'styled-components';
|
|
3
|
-
import { FC } from './generic-types';
|
|
4
|
-
export declare const isReactElementOfType: <P extends {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
target?: any;
|
|
8
|
-
}) => (element?: any) => element is ReactElement<P, string | import("react").JSXElementConstructor<any>>;
|
|
1
|
+
import { PureComponent, ReactElement } from 'react';
|
|
2
|
+
import { StyledComponent } from 'styled-components';
|
|
3
|
+
import { FC, PropsWithChildren } from './generic-types';
|
|
4
|
+
export declare const isReactElementOfType: <P extends PropsWithChildren>(component: (StyledComponent<FC<P>, any> | FC<P> | typeof PureComponent) & {
|
|
5
|
+
target?: any;
|
|
6
|
+
}) => (element?: any) => element is ReactElement<P>;
|
package/lib/helpers/nothing.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export {};
|
|
1
|
+
import { FC, PropsWithChildren } from './generic-types';
|
|
2
|
+
export declare const Nothing: FC;
|
|
3
|
+
export declare const isNothing: (element?: any) => element is import("react").ReactElement<{}, string | import("react").JSXElementConstructor<any>>;
|
|
4
|
+
export declare function maybeRender<T>(prop: T, JSX: JSX.Element): JSX.Element;
|
|
5
|
+
interface IIfProps {
|
|
6
|
+
is: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare const If: FC<PropsWithChildren<IIfProps>>;
|
|
9
|
+
export {};
|
package/lib/helpers/numbers.d.ts
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function clamp(a: number, b: number, c: number): number;
|
|
3
|
-
export declare function toHex(n: number, length: number): Hex;
|
|
4
|
-
export declare function concatHex(a: Hex, b: Hex): Hex;
|
|
5
|
-
/** given an array of boolean flags, bitwiseOr interprets them as an unsigned integer
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* bitwiseOr([false, true, false, true]) => 5 // 0b0101
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* This is useful for indexing into an enum:
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* const enum Level {
|
|
15
|
-
* default = 0,
|
|
16
|
-
* info = 0,
|
|
17
|
-
* danger = 1,
|
|
18
|
-
* warning = 2
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* interface IProps {
|
|
22
|
-
* info?: boolean
|
|
23
|
-
* danger?: boolean
|
|
24
|
-
* warning?: boolean
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* function toLevel(n: number): Level {
|
|
28
|
-
* switch (n) {
|
|
29
|
-
* case Level.info: return Level.info
|
|
30
|
-
* case Level.danger: return Level.danger
|
|
31
|
-
* case Level.warning: return Level.warning
|
|
32
|
-
* default: return Level.default
|
|
33
|
-
* }
|
|
34
|
-
* }
|
|
35
|
-
*
|
|
36
|
-
* const level = bitwiseOr([props.info, props.danger, props.warning])
|
|
37
|
-
*
|
|
38
|
-
* const levelEnum = toLevel(level)
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare function bitwiseOr(flags: unknown[]): number;
|
|
42
|
-
/** given a number, it returns the number formed by the rightmost set bit as 1 and the 0s that comes after it
|
|
43
|
-
*
|
|
44
|
-
* ```ts
|
|
45
|
-
* getRightmostSetBitNumber(12) => 4 // 12(1100) => 4(100)
|
|
46
|
-
* getRightmostSetBitNumber(40) => 8 // 40(101000) => 8(1000)
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* */
|
|
50
|
-
export declare function getRightmostSetBitNumber(n: number): number;
|
|
51
|
-
export declare function getNumberBetweenMinMax(input: number, min: number, max: number): number;
|
|
1
|
+
export type Hex = `#${string}`;
|
|
2
|
+
export declare function clamp(a: number, b: number, c: number): number;
|
|
3
|
+
export declare function toHex(n: number, length: number): Hex;
|
|
4
|
+
export declare function concatHex(a: Hex, b: Hex): Hex;
|
|
5
|
+
/** given an array of boolean flags, bitwiseOr interprets them as an unsigned integer
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* bitwiseOr([false, true, false, true]) => 5 // 0b0101
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* This is useful for indexing into an enum:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const enum Level {
|
|
15
|
+
* default = 0,
|
|
16
|
+
* info = 0,
|
|
17
|
+
* danger = 1,
|
|
18
|
+
* warning = 2
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* interface IProps {
|
|
22
|
+
* info?: boolean
|
|
23
|
+
* danger?: boolean
|
|
24
|
+
* warning?: boolean
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* function toLevel(n: number): Level {
|
|
28
|
+
* switch (n) {
|
|
29
|
+
* case Level.info: return Level.info
|
|
30
|
+
* case Level.danger: return Level.danger
|
|
31
|
+
* case Level.warning: return Level.warning
|
|
32
|
+
* default: return Level.default
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* const level = bitwiseOr([props.info, props.danger, props.warning])
|
|
37
|
+
*
|
|
38
|
+
* const levelEnum = toLevel(level)
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function bitwiseOr(flags: unknown[]): number;
|
|
42
|
+
/** given a number, it returns the number formed by the rightmost set bit as 1 and the 0s that comes after it
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* getRightmostSetBitNumber(12) => 4 // 12(1100) => 4(100)
|
|
46
|
+
* getRightmostSetBitNumber(40) => 8 // 40(101000) => 8(1000)
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* */
|
|
50
|
+
export declare function getRightmostSetBitNumber(n: number): number;
|
|
51
|
+
export declare function getNumberBetweenMinMax(input: number, min: number, max: number): number;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import first from 'lodash/first.js';
|
|
2
|
-
import isString from 'lodash/isString.js';
|
|
3
|
-
import isFunction from 'lodash/isFunction.js';
|
|
4
|
-
import uniqueId from 'lodash/uniqueId.js';
|
|
5
|
-
import debounce from 'lodash/debounce.js';
|
|
6
|
-
import isObject from 'lodash/isObject';
|
|
7
|
-
export { first, isString, isFunction, uniqueId, debounce, isObject };
|
|
8
|
-
/** even though we have null disabled in the repo,
|
|
9
|
-
* I still would not want isNil to skip checking null
|
|
10
|
-
* it is for juuuuust in case a third party sends us a null
|
|
11
|
-
* or something, and the types are not correct
|
|
12
|
-
*/
|
|
13
|
-
export declare function isNil<T>(value: T | undefined | null): value is undefined | null;
|
|
14
|
-
export declare function isDefined<T>(value: T | undefined | null): value is T;
|
|
15
|
-
export declare function defaultTo<T>(value: T | undefined | null, fallback: T): T;
|
|
16
|
-
export declare function isEmpty<T extends {
|
|
17
|
-
length: number;
|
|
18
|
-
}>(obj: T): boolean;
|
|
19
|
-
export declare function isNilOrEmpty<T extends {
|
|
20
|
-
length: number;
|
|
21
|
-
}>(obj?: T): boolean;
|
|
22
|
-
/** used for evaluating tri-state logic (true | false | undefined) */
|
|
23
|
-
export declare function is(pred?: boolean): boolean;
|
|
24
|
-
export declare function toArray<T>(obj: T | T[] | undefined | null): T[];
|
|
25
|
-
export declare function safeArray<T>(arr: T[] | undefined | null): T[];
|
|
26
|
-
export declare function safeCallback<T>(f?: (e: T) => void, e?: T): void;
|
|
1
|
+
import first from 'lodash/first.js';
|
|
2
|
+
import isString from 'lodash/isString.js';
|
|
3
|
+
import isFunction from 'lodash/isFunction.js';
|
|
4
|
+
import uniqueId from 'lodash/uniqueId.js';
|
|
5
|
+
import debounce from 'lodash/debounce.js';
|
|
6
|
+
import isObject from 'lodash/isObject';
|
|
7
|
+
export { first, isString, isFunction, uniqueId, debounce, isObject };
|
|
8
|
+
/** even though we have null disabled in the repo,
|
|
9
|
+
* I still would not want isNil to skip checking null
|
|
10
|
+
* it is for juuuuust in case a third party sends us a null
|
|
11
|
+
* or something, and the types are not correct
|
|
12
|
+
*/
|
|
13
|
+
export declare function isNil<T>(value: T | undefined | null): value is undefined | null;
|
|
14
|
+
export declare function isDefined<T>(value: T | undefined | null): value is T;
|
|
15
|
+
export declare function defaultTo<T>(value: T | undefined | null, fallback: T): T;
|
|
16
|
+
export declare function isEmpty<T extends {
|
|
17
|
+
length: number;
|
|
18
|
+
}>(obj: T): boolean;
|
|
19
|
+
export declare function isNilOrEmpty<T extends {
|
|
20
|
+
length: number;
|
|
21
|
+
}>(obj?: T): boolean;
|
|
22
|
+
/** used for evaluating tri-state logic (true | false | undefined) */
|
|
23
|
+
export declare function is(pred?: boolean): boolean;
|
|
24
|
+
export declare function toArray<T>(obj: T | T[] | undefined | null): T[];
|
|
25
|
+
export declare function safeArray<T>(arr: T[] | undefined | null): T[];
|
|
26
|
+
export declare function safeCallback<T>(f?: (e: T) => void, e?: T): void;
|
package/lib/helpers/slots.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { CSSProperties, PureComponent, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { FC, PropsWithChildren } from './generic-types';
|
|
3
|
-
export declare const isSlotOfType: <T extends typeof Slot>(type: T | FC
|
|
4
|
-
export declare class Slot<T = unknown> extends PureComponent<PropsWithChildren<T>> {
|
|
5
|
-
render(): PropsWithChildren<T>["children"] | undefined;
|
|
6
|
-
}
|
|
7
|
-
export declare class StylableSlot extends Slot {
|
|
8
|
-
render(): JSX.Element;
|
|
9
|
-
}
|
|
10
|
-
/** gets children that are _not_ slots */
|
|
11
|
-
export declare function getOtherChildren(children?: ReactNode): ReactNode[];
|
|
12
|
-
export declare function getSlots<T extends typeof Slot>(slot: T, children?: ReactNode): ReactElement[];
|
|
13
|
-
export declare function getSlot<T extends typeof Slot>(slot: T, children?: ReactNode): ReactElement;
|
|
14
|
-
/** given a ReactElement, like a child, apply the given props to it */
|
|
15
|
-
export declare function applyProps<T>(element: ReactElement<T>, props: Partial<T>): ReactElement;
|
|
16
|
-
/** given a ReactElement, like a child, apply the given styles to it, merging with the existing styles */
|
|
17
|
-
export declare function applyStyle(element: ReactElement, style: CSSProperties): ReactElement;
|
|
1
|
+
import { CSSProperties, PureComponent, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { FC, PropsWithChildren } from './generic-types';
|
|
3
|
+
export declare const isSlotOfType: <T extends typeof Slot>(type: T | FC) => (obj?: any) => obj is T;
|
|
4
|
+
export declare class Slot<T = unknown> extends PureComponent<PropsWithChildren<T>> {
|
|
5
|
+
render(): PropsWithChildren<T>["children"] | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare class StylableSlot extends Slot {
|
|
8
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
/** gets children that are _not_ slots */
|
|
11
|
+
export declare function getOtherChildren(children?: ReactNode): ReactNode[];
|
|
12
|
+
export declare function getSlots<T extends typeof Slot>(slot: T, children?: ReactNode): ReactElement[];
|
|
13
|
+
export declare function getSlot<T extends typeof Slot>(slot: T, children?: ReactNode): ReactElement;
|
|
14
|
+
/** given a ReactElement, like a child, apply the given props to it */
|
|
15
|
+
export declare function applyProps<T>(element: ReactElement<T>, props: Partial<T>): ReactElement;
|
|
16
|
+
/** given a ReactElement, like a child, apply the given styles to it, merging with the existing styles */
|
|
17
|
+
export declare function applyStyle(element: ReactElement, style: CSSProperties): ReactElement;
|
package/lib/helpers/strings.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const toKebabCase: (str: string) => string;
|
|
1
|
+
export declare const toKebabCase: (str: string) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function useOnClickOutside(handler: (event: Event) => void): React.RefObject<HTMLDivElement>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function useOnClickOutside(handler: (event: Event) => void): React.RefObject<HTMLDivElement>;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
T | undefined,
|
|
3
|
-
(change: T) => void
|
|
4
|
-
];
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* This hook is to help implement a common pattern:
|
|
8
|
-
*
|
|
9
|
-
* <input onChange={doSomething} /> // uncontrolled
|
|
10
|
-
* <input value={1} /> // should be marked read only
|
|
11
|
-
* <input value={state} onChange={setState} /> // controlled
|
|
12
|
-
*
|
|
13
|
-
* I've reimplemented this logic a few times, but now I have a nice helper :D
|
|
14
|
-
*
|
|
15
|
-
* const [state, setState] = useInputElementState({
|
|
16
|
-
* value: props.value,
|
|
17
|
-
* defaultValue: props.defaultValue, // the value to use if value is undefined
|
|
18
|
-
* onChange: props.onChange,
|
|
19
|
-
* })
|
|
20
|
-
*
|
|
21
|
-
* if you give it nothing, you get state, setState for internal state management (uncontrolled input)
|
|
22
|
-
* if you give it value only, you get a warning
|
|
23
|
-
* if you give it value and onChange, state management if deferred to the parent (controlled input)
|
|
24
|
-
*/
|
|
25
|
-
export declare function useInputElementState<T>(props: {
|
|
26
|
-
value?: T;
|
|
27
|
-
defaultValue?: T;
|
|
28
|
-
onChange?: (change: T) => void;
|
|
29
|
-
}): IInputElementState<T>;
|
|
30
|
-
export {};
|
|
1
|
+
type IInputElementState<T> = [
|
|
2
|
+
T | undefined,
|
|
3
|
+
(change: T) => void
|
|
4
|
+
];
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* This hook is to help implement a common pattern:
|
|
8
|
+
*
|
|
9
|
+
* <input onChange={doSomething} /> // uncontrolled
|
|
10
|
+
* <input value={1} /> // should be marked read only
|
|
11
|
+
* <input value={state} onChange={setState} /> // controlled
|
|
12
|
+
*
|
|
13
|
+
* I've reimplemented this logic a few times, but now I have a nice helper :D
|
|
14
|
+
*
|
|
15
|
+
* const [state, setState] = useInputElementState({
|
|
16
|
+
* value: props.value,
|
|
17
|
+
* defaultValue: props.defaultValue, // the value to use if value is undefined
|
|
18
|
+
* onChange: props.onChange,
|
|
19
|
+
* })
|
|
20
|
+
*
|
|
21
|
+
* if you give it nothing, you get state, setState for internal state management (uncontrolled input)
|
|
22
|
+
* if you give it value only, you get a warning
|
|
23
|
+
* if you give it value and onChange, state management if deferred to the parent (controlled input)
|
|
24
|
+
*/
|
|
25
|
+
export declare function useInputElementState<T>(props: {
|
|
26
|
+
value?: T;
|
|
27
|
+
defaultValue?: T;
|
|
28
|
+
onChange?: (change: T) => void;
|
|
29
|
+
}): IInputElementState<T>;
|
|
30
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useIsMobile: () => boolean;
|
|
1
|
+
export declare const useIsMobile: () => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useKeyDown(targetKey: string, handler: () => void): void;
|
|
1
|
+
export declare function useKeyDown(targetKey: string, handler: () => void): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edvisor/product-language",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.113",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Edvisor.io product-language components",
|
|
6
6
|
"repository": "https://github.com/edvisor-io/front-end/",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
},
|
|
42
42
|
"release-it": {
|
|
43
43
|
"git": {
|
|
44
|
+
"changelog": "git log --pretty=format:'* %s (%h)' ${latestTag}...HEAD -- .",
|
|
44
45
|
"requireCleanWorkingDir": false,
|
|
45
|
-
"commitMessage": "chore: release ${version}
|
|
46
|
-
"tagName": "v${version}"
|
|
46
|
+
"commitMessage": "chore: release frontend-v${version} [skip ci]",
|
|
47
|
+
"tagName": "frontend-v${version}"
|
|
47
48
|
},
|
|
48
49
|
"github": {
|
|
49
|
-
"release": true
|
|
50
|
-
"tokenRef": "BOB"
|
|
50
|
+
"release": true
|
|
51
51
|
},
|
|
52
52
|
"npm": {
|
|
53
53
|
"publish": false,
|