@sitecore/sc-contenthub-blok 1.0.27 → 1.0.28

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 (40) hide show
  1. package/esm/BlokTheme.d.ts +5 -0
  2. package/esm/Components/BlokAlert/BlokAlert.d.ts +33 -0
  3. package/esm/Components/BlokBadge/BlokBadge.d.ts +23 -0
  4. package/esm/Components/BlokBreadcrumb/BlokBreadcrumb.d.ts +3 -0
  5. package/esm/Components/BlokBreadcrumb/BlokBreadcrumbItem.d.ts +13 -0
  6. package/esm/Components/BlokButton/BlokButton.d.ts +52 -0
  7. package/esm/Components/BlokButtonGroup/BlokButtonGroup.d.ts +9 -0
  8. package/esm/Components/BlokButtonSelect/BlokButtonSelect.d.ts +10 -0
  9. package/esm/Components/BlokIcon/BlokIcon.d.ts +20 -0
  10. package/esm/Components/BlokIcon/BlokIconContext.d.ts +13 -0
  11. package/esm/Components/BlokIcon/IconDownloadManager.d.ts +22 -0
  12. package/esm/Components/BlokIcon/iconNames.d.ts +2 -0
  13. package/esm/Components/BlokIcon/useSvgIcon.d.ts +21 -0
  14. package/esm/Components/BlokIconButton/BlokIconButton.d.ts +5 -0
  15. package/esm/Components/BlokImage/BlokImage.d.ts +16 -0
  16. package/esm/Components/BlokLabeledIcon/BlokLabeledIcon.d.ts +13 -0
  17. package/esm/Components/BlokLink/BlokLink.d.ts +14 -0
  18. package/esm/Components/BlokSearchBox/BlokSearchBox.d.ts +155 -0
  19. package/esm/Components/BlokSelect/BlokSelect.d.ts +116 -0
  20. package/esm/Components/BlokTag/BlokTag.d.ts +24 -0
  21. package/esm/Components/BlokTooltip/BlokTooltip.d.ts +9 -0
  22. package/esm/Components/CoreComponents.d.ts +8 -0
  23. package/esm/Components/index.d.ts +18 -0
  24. package/esm/Foundations/borderRadius.d.ts +12 -0
  25. package/esm/Foundations/buttons.d.ts +8 -0
  26. package/esm/Foundations/colors.d.ts +561 -0
  27. package/esm/Foundations/fontSizes.d.ts +22 -0
  28. package/esm/Foundations/fontWeights.d.ts +10 -0
  29. package/esm/Foundations/index.d.ts +11 -0
  30. package/esm/Foundations/semanticTokens.d.ts +71 -0
  31. package/esm/Foundations/shadows.d.ts +22 -0
  32. package/esm/Foundations/sizes.d.ts +51 -0
  33. package/esm/Foundations/spacing.d.ts +35 -0
  34. package/esm/Foundations/typography.d.ts +44 -0
  35. package/esm/Foundations/utils.d.ts +39 -0
  36. package/esm/SourceCode.d.ts +4 -0
  37. package/esm/customHooks/useIsMounted.d.ts +8 -0
  38. package/esm/index.d.ts +5 -0
  39. package/esm/useIsDarkTheme.d.ts +2 -0
  40. package/package.json +1 -1
@@ -0,0 +1,155 @@
1
+ import { ClipboardEventHandler, type FC, KeyboardEvent, type ReactNode, Ref } from "react";
2
+ import { Optional } from "../../Foundations/utils";
3
+ export declare const SEARCH_BOX_MAX_WIDTH = 500;
4
+ export declare const SEARCH_BOX_MULTI_LINE_MAX_HEIGHT = 130;
5
+ export declare const DEFAULT_SEARCH_BOX_HEIGHT = "36px";
6
+ export interface BlokSearchBoxSlots {
7
+ slot1?: ReactNode;
8
+ slot2?: ReactNode;
9
+ }
10
+ export interface BlokSearchBoxProps {
11
+ /**
12
+ * Callback when typing into the searchBox.
13
+ */
14
+ onSearch: (searchFilter: string) => void;
15
+ /**
16
+ * Callback when clearing the searchBox.
17
+ */
18
+ onClearSearch?: () => void;
19
+ /**
20
+ * Callback when pushing the enter button.
21
+ */
22
+ onEnterPress?: () => void;
23
+ /**
24
+ * Value for the search filter.
25
+ */
26
+ value: string;
27
+ /**
28
+ * A class name to overrule some styles.
29
+ */
30
+ className?: string;
31
+ /**
32
+ * Placeholder text for the searchBox.
33
+ */
34
+ placeholder?: string;
35
+ /**
36
+ * Indicates if the search needs to be canceled when the ESC key is pressed.
37
+ */
38
+ cancelOnEscape?: boolean;
39
+ /**
40
+ * Indicates if the searchBox should stay in view (will render with a white background and shadow).
41
+ */
42
+ isSticky?: boolean;
43
+ /**
44
+ * The top position of the sticky searchBox in px.
45
+ */
46
+ stickyTopPosition?: string;
47
+ /**
48
+ * Indicates if the searchBox should be auto focused.
49
+ */
50
+ isAutofocus?: boolean;
51
+ /**
52
+ * Indicates if the searchBox is used inside a dropdown.
53
+ */
54
+ isInsideDropdown?: boolean;
55
+ /**
56
+ * Indicate if the searchBox should be disabled.
57
+ */
58
+ isDisabled?: boolean;
59
+ /**
60
+ * Indicates if the searchBox should have a bottom gutter.
61
+ */
62
+ hasGutterBottom?: boolean;
63
+ /**
64
+ * Optional sticky searchBox background color.
65
+ */
66
+ stickySearchBoxBackground?: string;
67
+ /**
68
+ * Optional status to show the sticky search box in scrolled status.
69
+ */
70
+ shouldShowScrolledStatus?: boolean;
71
+ /**
72
+ * Optional class name for the clear button to override some styles.
73
+ */
74
+ clearButtonClassName?: string;
75
+ /**
76
+ * Allows the keypress events to propagate (for the autosuggest).
77
+ */
78
+ allowKeyPressPropagation?: boolean;
79
+ /**
80
+ * A function to handle the keyPresses (for autosuggest).
81
+ */
82
+ handleKeyPress?: (e: KeyboardEvent<HTMLTextAreaElement>) => void;
83
+ /**
84
+ * A callback to call when pasting a value.
85
+ */
86
+ onPaste?: ClipboardEventHandler<HTMLTextAreaElement>;
87
+ /**
88
+ * Max number of characters a user can type.
89
+ */
90
+ maxNumberOfCharacters?: number;
91
+ /**
92
+ * Max number of words a user can type.
93
+ */
94
+ maxNumberOfWords?: number;
95
+ /**
96
+ * Clear message to show when hovering over the clear button.
97
+ */
98
+ clearMessage: string;
99
+ /**
100
+ * Search message to show when hovering over the search button.
101
+ */
102
+ searchMessage: string;
103
+ /**
104
+ * Indicates if the searchBox should allow multiple lines.
105
+ */
106
+ allowMultipleLines?: boolean;
107
+ /**
108
+ * Slots for rendering custom content in different parts of the search box.
109
+ */
110
+ slots?: BlokSearchBoxSlots;
111
+ /**
112
+ * Indicates if the searchBox should have a limited width.
113
+ */
114
+ hasLimitedWidth?: boolean;
115
+ /**
116
+ * When true, the multiline search box will expand and overlay content below it.
117
+ * When false, it will push content down as it expands.
118
+ */
119
+ expandOverContent?: boolean;
120
+ /**
121
+ * Icon to show in the search button.
122
+ */
123
+ searchIcon?: string;
124
+ /**
125
+ * An optional search icon image to show in the search button instead of a normal icon (e.g. for AI search).
126
+ */
127
+ searchIconImage?: string;
128
+ /**
129
+ * Indicates if the searchBox should be shown with specific AI styles.
130
+ */
131
+ applyAiStyles?: boolean;
132
+ /**
133
+ * A function to handle pasted text.
134
+ * @param text
135
+ */
136
+ handlePastedText?: (pastedText: string, searchBoxValue: string) => string;
137
+ /**
138
+ * Indicates if the searchBox should show a character counter.
139
+ * For this a maxNumberOfCharacters prop is required.
140
+ */
141
+ showCounter?: boolean;
142
+ /**
143
+ * When provided, text matching this regular expression will be exempt from character and word limitations.
144
+ * For example, when the text contains id= we ignore the limitations.
145
+ */
146
+ ignoreLimitationsRegex?: RegExp;
147
+ /**
148
+ * A function to transform the typed text.
149
+ */
150
+ transformTypedText?: (text: string) => string;
151
+ ref?: Ref<HTMLTextAreaElement>;
152
+ }
153
+ export declare const truncateString: (str: string, maxChars: Optional<number>, maxWords: Optional<number>) => string;
154
+ export declare const BlokSearchBox: FC<BlokSearchBoxProps>;
155
+ //# sourceMappingURL=BlokSearchBox.d.ts.map
@@ -0,0 +1,116 @@
1
+ import { ReactElement } from "react";
2
+ import { Nullable } from "../../Foundations/utils";
3
+ interface BlokSelectProps<T, K> {
4
+ /**
5
+ * Unique id of the SelectMenu.
6
+ */
7
+ id: string;
8
+ /**
9
+ * Different options that menu provides.
10
+ */
11
+ options: Array<T>;
12
+ /**
13
+ * OnChange function to propagate the new item back to the parent.
14
+ */
15
+ onChange: (item: K) => void | Promise<void> | unknown;
16
+ /**
17
+ * The current value of the SelectMenu.
18
+ */
19
+ value?: T;
20
+ /**
21
+ * A function that maps the item to a label.
22
+ */
23
+ labelMapper?: (item: T) => string;
24
+ /**
25
+ * A function that maps the item to a value.
26
+ */
27
+ valueMapper?: (item: T) => string;
28
+ /**
29
+ * Callback that returns the value of the selected item.
30
+ */
31
+ returnValue?: (item: T) => K;
32
+ /**
33
+ * Placeholder in case no value is found.
34
+ */
35
+ placeholder?: string;
36
+ /**
37
+ * Indicates if an empty value should be selectable.
38
+ */
39
+ emptyValueSelectable?: boolean;
40
+ /**
41
+ * Custom css class name to overrule some styling.
42
+ */
43
+ className?: string;
44
+ /**
45
+ * IsReadOnly mode for SelectMenu component.
46
+ */
47
+ isReadOnly?: boolean;
48
+ /**
49
+ * The minimum amount of items to have before searchbox is shown.
50
+ */
51
+ searchBoxMinAmountOfItems?: number;
52
+ /**
53
+ * An optional tooltip that is shown on hover.
54
+ */
55
+ tooltip?: string;
56
+ /**
57
+ * Indicates if both the icon and text for selected value should be displayed (e.g. search grouping column and row dropdowns).
58
+ */
59
+ showIconAndText?: boolean;
60
+ /**
61
+ * Indicates if the icons on the dropdown items should be hidden (e.g. search grouping column and row dropdown values).
62
+ */
63
+ hideItemIcons?: boolean;
64
+ /**
65
+ * Indicates if the select menu button should be full width (to align it with text boxes that are also full width).
66
+ */
67
+ isFullWidth?: boolean;
68
+ /**
69
+ * Used to link a label that can focus the select menu
70
+ */
71
+ accessibilityId?: string;
72
+ /**
73
+ * An optional max height for the dropdown.
74
+ */
75
+ maxHeight?: number;
76
+ /**
77
+ * An optional array of items to disable.
78
+ */
79
+ itemsToDisable?: Array<T>;
80
+ /**
81
+ * Indicates whether the dropdown should be open on initial render. Defaults to false.
82
+ */
83
+ openMenuByDefault?: boolean;
84
+ /**
85
+ * Indicates whether the dropdown should be rendered when there is no option available.
86
+ */
87
+ showEmptyDropdown?: boolean;
88
+ /**
89
+ * The message to show when no results are found.
90
+ */
91
+ noneLabel?: string;
92
+ /**
93
+ * The message to show when no results are found.
94
+ */
95
+ noResultsText?: string;
96
+ /**
97
+ * Clear message to show when hovering over the clear button.
98
+ */
99
+ clearMessage: string;
100
+ /**
101
+ * Search message to show when hovering over the search button.
102
+ */
103
+ searchMessage: string;
104
+ /**
105
+ * Indicates whether the select is in a loading state.
106
+ */
107
+ isLoading?: boolean;
108
+ /**
109
+ * Loading text to show when in loading state.
110
+ */
111
+ loadingText?: string;
112
+ }
113
+ declare function BlokSelect<T = string, K = T>({ id, options, onChange: onChange_, value, labelMapper, valueMapper, returnValue, placeholder, emptyValueSelectable, className, isReadOnly, searchBoxMinAmountOfItems, tooltip, showIconAndText, hideItemIcons, isFullWidth, accessibilityId, maxHeight, itemsToDisable, openMenuByDefault, showEmptyDropdown, noneLabel, noResultsText, clearMessage, searchMessage, isLoading, loadingText, }: BlokSelectProps<T, K>): Nullable<ReactElement>;
114
+ export { BlokSelect };
115
+ export type { BlokSelectProps };
116
+ //# sourceMappingURL=BlokSelect.d.ts.map
@@ -0,0 +1,24 @@
1
+ import { type FC, type PropsWithChildren, type ReactNode } from "react";
2
+ import { type ColorName } from "../../Foundations";
3
+ export interface BlokTagSlots {
4
+ start?: ReactNode;
5
+ end?: ReactNode;
6
+ }
7
+ export interface BlokTagProps {
8
+ size?: "sm" | "md" | "lg" | "xl";
9
+ startIcon?: ReactNode;
10
+ endIcon?: ReactNode;
11
+ onDelete?: () => void;
12
+ colorScheme?: ColorName;
13
+ deleteLabel?: string;
14
+ className?: string;
15
+ expandedContent?: ReactNode;
16
+ expandLabel?: string;
17
+ collapseLabel?: string;
18
+ allowMultiline?: boolean;
19
+ deleteId?: string;
20
+ onClick?: () => void;
21
+ slots?: BlokTagSlots;
22
+ }
23
+ export declare const BlokTag: FC<PropsWithChildren<BlokTagProps>>;
24
+ //# sourceMappingURL=BlokTag.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from "react";
2
+ interface TooltipProps {
3
+ placement?: string;
4
+ title: string;
5
+ tooltipId?: string;
6
+ }
7
+ export declare const BlokTooltip: FC<PropsWithChildren<TooltipProps>>;
8
+ export {};
9
+ //# sourceMappingURL=BlokTooltip.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { SxProps } from "@mui/material";
2
+ import * as colors from "@mui/material/colors";
3
+ export type { SxProps };
4
+ export { colors };
5
+ export * from "@mui/material";
6
+ export * from "@mui/material/styles";
7
+ export type AlertColor = "success" | "info" | "warning" | "error" | "neutral" | "ai";
8
+ //# sourceMappingURL=CoreComponents.d.ts.map
@@ -0,0 +1,18 @@
1
+ export * from "./BlokAlert/BlokAlert";
2
+ export * from "./BlokBadge/BlokBadge";
3
+ export * from "./BlokBreadcrumb/BlokBreadcrumb";
4
+ export * from "./BlokBreadcrumb/BlokBreadcrumbItem";
5
+ export * from "./BlokButton/BlokButton";
6
+ export * from "./BlokButtonGroup/BlokButtonGroup";
7
+ export * from "./BlokButtonSelect/BlokButtonSelect";
8
+ export * from "./BlokIcon/BlokIcon";
9
+ export * from "./BlokIcon/BlokIconContext";
10
+ export * from "./BlokIconButton/BlokIconButton";
11
+ export * from "./BlokImage/BlokImage";
12
+ export * from "./BlokLabeledIcon/BlokLabeledIcon";
13
+ export * from "./BlokLink/BlokLink";
14
+ export * from "./BlokSearchBox/BlokSearchBox";
15
+ export * from "./BlokSelect/BlokSelect";
16
+ export * from "./BlokTag/BlokTag";
17
+ export * from "./BlokTooltip/BlokTooltip";
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ export declare const borderRadiusSm: string | number;
2
+ export declare const borderRadiusBase: string | number;
3
+ export declare const borderRadiusMd: string | number;
4
+ export declare const borderRadiusLg: string | number;
5
+ export declare const borderRadiusXl: string | number;
6
+ export declare const borderRadius2xl: string | number;
7
+ export declare const borderRadius3xl: string | number;
8
+ export declare const borderRadiusFull: string | number;
9
+ export declare const btnBorderRadius: string | number;
10
+ export declare const baseBorderRadius: string | number;
11
+ export declare const borderRadiusNone = 0;
12
+ //# sourceMappingURL=borderRadius.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { type ColorShade } from "./colors";
2
+ export declare const btnFontWeight: "bold" | "normal" | number;
3
+ export declare const btnFontFamily: string;
4
+ export declare const btnTextTransform: "capitalize" | "full-size-kana" | "full-width" | "lowercase" | "none" | "uppercase";
5
+ export declare const buttonPadding = "0.375rem 0.75rem";
6
+ export declare const getGhostButtonBackgroundColor: (color: string, isDarkTheme: boolean, darkShade: ColorShade, lightShade: ColorShade) => string;
7
+ export declare const getSolidButtonBackgroundColor: (color: string, isDarkTheme: boolean, darkShade: ColorShade, lightShade: ColorShade) => string;
8
+ //# sourceMappingURL=buttons.d.ts.map