@conveyorhq/arrow-ds 1.37.0 → 1.40.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/package.json +1 -1
- package/public/components/Accordion/Accordion.d.ts +3 -3
- package/public/components/Accordion/Accordion.js +12 -7
- package/public/components/Accordion/context.d.ts +4 -2
- package/public/components/Accordion/context.js +2 -0
- package/public/components/Accordion/types.d.ts +1 -1
- package/public/components/Icon/Icon.d.ts +4 -1
- package/public/components/Icon/Icon.js +7 -1
- package/public/components/Kbd/Kbd.d.ts +3 -0
- package/public/components/Kbd/Kbd.js +14 -0
- package/public/components/Kbd/index.d.ts +1 -0
- package/public/components/Kbd/index.js +13 -0
- package/public/components/ScrollSpy/ScrollSpy.d.ts +3 -1
- package/public/components/ScrollSpy/ScrollSpy.js +7 -1
- package/public/css/styles.css +25 -0
- package/public/css/styles.min.css +1 -1
- package/public/css/styles.min.css.map +1 -1
- package/public/index.d.ts +1 -0
- package/public/index.js +1 -0
- package/src/components/Accordion/Accordion.tsx +28 -9
- package/src/components/Accordion/context.ts +5 -1
- package/src/components/Accordion/types.ts +1 -1
- package/src/components/Icon/Icon.tsx +9 -0
- package/src/components/Kbd/Kbd.story.mdx +44 -0
- package/src/components/Kbd/Kbd.tsx +11 -0
- package/src/components/Kbd/index.css +17 -0
- package/src/components/Kbd/index.ts +1 -0
- package/src/components/ScrollSpy/ScrollSpy.tsx +22 -0
- package/src/components/ScrollSpy/index.css +3 -0
- package/src/css/components.css +2 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { BoxProps } from "../Box";
|
|
3
3
|
import { StackProps } from "../Stack";
|
|
4
4
|
import type { AccordionOwnProps, AccordionItemOwnProps, AccordionDisclosureProps, AccordionGroupOwnProps } from "./types";
|
|
5
|
-
export declare type AccordionGroupProps = AccordionGroupOwnProps & Pick<StackProps, "children" | "spacing">;
|
|
6
|
-
export declare const AccordionGroup: ({ children, spacing, defaultValue, disableAnimation, ...rest }: AccordionGroupProps) => JSX.Element;
|
|
5
|
+
export declare type AccordionGroupProps = AccordionGroupOwnProps & Pick<StackProps, "children" | "spacing" | "className">;
|
|
6
|
+
export declare const AccordionGroup: ({ children, spacing, defaultValue, disableAnimation, className, ...rest }: AccordionGroupProps) => JSX.Element;
|
|
7
7
|
export declare type AccordionItemProps = AccordionItemOwnProps & BoxProps;
|
|
8
8
|
export declare const AccordionItem: ({ value, defaultIsOpen: defaultIsOpenProp, children, className, ...rest }: AccordionItemProps) => JSX.Element;
|
|
9
9
|
declare type AccordionButtonChildProps = Omit<AccordionDisclosureProps, "onToggle">;
|
|
@@ -25,7 +25,7 @@ export declare const AccordionContent: ({ children, maxHeight, style, className,
|
|
|
25
25
|
export declare type AccordionProps = AccordionOwnProps & BoxProps;
|
|
26
26
|
export declare const Accordion: {
|
|
27
27
|
(props: AccordionProps): JSX.Element;
|
|
28
|
-
Group: ({ children, spacing, defaultValue, disableAnimation, ...rest }: AccordionGroupProps) => JSX.Element;
|
|
28
|
+
Group: ({ children, spacing, defaultValue, disableAnimation, className, ...rest }: AccordionGroupProps) => JSX.Element;
|
|
29
29
|
Item: ({ value, defaultIsOpen: defaultIsOpenProp, children, className, ...rest }: AccordionItemProps) => JSX.Element;
|
|
30
30
|
Button: React.ForwardRefExoticComponent<AccordionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
31
31
|
Content: ({ children, maxHeight, style, className, ...rest }: AccordionContentProps) => JSX.Element;
|
|
@@ -20,9 +20,10 @@ const Heading_1 = require("../Heading");
|
|
|
20
20
|
const Icon_1 = require("../Icon");
|
|
21
21
|
const context_1 = require("./context");
|
|
22
22
|
const cn = utilities_1.bemHOF("Accordion");
|
|
23
|
-
const AccordionGroup = ({ children, spacing = 0, defaultValue, disableAnimation, ...rest }) => {
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const AccordionGroup = ({ children, spacing = 0, defaultValue, disableAnimation, className, ...rest }) => {
|
|
24
|
+
const totalItems = react_1.default.Children.count(children);
|
|
25
|
+
return (react_1.default.createElement(context_1.AccordionGroupContext.Provider, { value: { defaultValue, disableAnimation, totalItems } },
|
|
26
|
+
react_1.default.createElement(Stack_1.Stack, Object.assign({ orientation: types_1.ORIENTATION.VERTICAL, spacing: spacing, className: className }, rest), children)));
|
|
26
27
|
};
|
|
27
28
|
exports.AccordionGroup = AccordionGroup;
|
|
28
29
|
const AccordionItem = ({ value, defaultIsOpen: defaultIsOpenProp, children, className, ...rest }) => {
|
|
@@ -31,7 +32,7 @@ const AccordionItem = ({ value, defaultIsOpen: defaultIsOpenProp, children, clas
|
|
|
31
32
|
const defaultIsOpen = typeof defaultIsOpenProp === "undefined"
|
|
32
33
|
? hasDefaultValue
|
|
33
34
|
: defaultIsOpenProp;
|
|
34
|
-
const { isOpen, onToggle } = hooks_1.useDisclosure(defaultIsOpen);
|
|
35
|
+
const { isOpen, onToggle, onClose } = hooks_1.useDisclosure(defaultIsOpen);
|
|
35
36
|
const id = `accordion-${auto_id_1.useId()}`;
|
|
36
37
|
const buttonId = `${id}-button`;
|
|
37
38
|
const contentId = `${id}-content`;
|
|
@@ -39,8 +40,10 @@ const AccordionItem = ({ value, defaultIsOpen: defaultIsOpenProp, children, clas
|
|
|
39
40
|
defaultIsOpen,
|
|
40
41
|
isOpen,
|
|
41
42
|
onToggle,
|
|
43
|
+
onClose,
|
|
42
44
|
buttonId,
|
|
43
45
|
contentId,
|
|
46
|
+
value,
|
|
44
47
|
} },
|
|
45
48
|
react_1.default.createElement(Box_1.Box, Object.assign({ "data-component": "accordion", className: classnames_1.default(cn(), className, {
|
|
46
49
|
[cn({ m: "isOpen" })]: isOpen,
|
|
@@ -49,7 +52,7 @@ const AccordionItem = ({ value, defaultIsOpen: defaultIsOpenProp, children, clas
|
|
|
49
52
|
exports.AccordionItem = AccordionItem;
|
|
50
53
|
exports.AccordionButton = react_1.default.forwardRef((props, forwardedRef) => {
|
|
51
54
|
const { children, className, onClick, disabled = false, ...rest } = props;
|
|
52
|
-
const { buttonId, contentId, isOpen, onToggle } = context_1.useAccordionItemContext();
|
|
55
|
+
const { buttonId, contentId, isOpen, onToggle, onClose, } = context_1.useAccordionItemContext();
|
|
53
56
|
const buttonRef = react_1.default.useRef(null);
|
|
54
57
|
const ref = react_merge_refs_1.default([forwardedRef, buttonRef]);
|
|
55
58
|
return (react_1.default.createElement("button", Object.assign({ ref: ref, type: "button", className: className, id: buttonId, "aria-controls": contentId, "aria-expanded": isOpen, "aria-disabled": disabled, disabled: disabled, onClick: (event) => {
|
|
@@ -59,7 +62,9 @@ exports.AccordionButton = react_1.default.forwardRef((props, forwardedRef) => {
|
|
|
59
62
|
if (onToggle) {
|
|
60
63
|
onToggle();
|
|
61
64
|
}
|
|
62
|
-
} }, rest), typeof children === "function"
|
|
65
|
+
} }, rest), typeof children === "function"
|
|
66
|
+
? children({ isOpen, onClose })
|
|
67
|
+
: children));
|
|
63
68
|
});
|
|
64
69
|
const AccordionContent = ({ children, maxHeight, style, className, ...rest }) => {
|
|
65
70
|
const { disableAnimation } = context_1.useAccordionGroupContext();
|
|
@@ -73,7 +78,7 @@ const AccordionContent = ({ children, maxHeight, style, className, ...rest }) =>
|
|
|
73
78
|
const { height } = component_size_1.default(childrenRef);
|
|
74
79
|
const heightObj = { height };
|
|
75
80
|
const [enableTransition, setEnableTransition] = react_1.default.useState(!defaultIsOpen);
|
|
76
|
-
return (react_1.default.createElement(renderprops_1.Transition, { items: isOpen, from: { height: 0 }, enter: { height }, leave: { height: 0 }, update: heightObj, onRest: () => {
|
|
81
|
+
return (react_1.default.createElement(renderprops_1.Transition, { items: isOpen, from: { height: 0, opacity: 0 }, enter: { height, opacity: 1 }, leave: { height: 0, opacity: 0 }, update: heightObj, onRest: () => {
|
|
77
82
|
if (defaultIsOpen && isOpen) {
|
|
78
83
|
setEnableTransition(true);
|
|
79
84
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Context } from "react";
|
|
2
2
|
import type { AccordionGroupOwnProps, AccordionItemOwnProps, AccordionDisclosureProps } from "./types";
|
|
3
|
-
declare type AccordionGroupContextType =
|
|
3
|
+
declare type AccordionGroupContextType = {
|
|
4
|
+
totalItems?: number;
|
|
5
|
+
} & AccordionGroupOwnProps;
|
|
4
6
|
export declare const AccordionGroupContext: Context<AccordionGroupContextType>;
|
|
5
|
-
export declare function useAccordionGroupContext():
|
|
7
|
+
export declare function useAccordionGroupContext(): AccordionGroupContextType;
|
|
6
8
|
declare type AccordionItemContextType = AccordionItemOwnProps & AccordionDisclosureProps & {
|
|
7
9
|
buttonId: string;
|
|
8
10
|
contentId: string;
|
|
@@ -5,6 +5,7 @@ const react_1 = require("react");
|
|
|
5
5
|
const defaultGroupContext = {
|
|
6
6
|
defaultValue: undefined,
|
|
7
7
|
disableAnimation: false,
|
|
8
|
+
totalItems: 0,
|
|
8
9
|
};
|
|
9
10
|
exports.AccordionGroupContext = react_1.createContext(defaultGroupContext);
|
|
10
11
|
function useAccordionGroupContext() {
|
|
@@ -18,6 +19,7 @@ const defaultContext = {
|
|
|
18
19
|
defaultIsOpen: false,
|
|
19
20
|
isOpen: false,
|
|
20
21
|
onToggle: () => { },
|
|
22
|
+
onClose: () => { },
|
|
21
23
|
buttonId: "accordion-0-button",
|
|
22
24
|
contentId: "accordion-0-content",
|
|
23
25
|
};
|
|
@@ -15,4 +15,4 @@ export declare type AccordionOwnProps = Pick<AccordionItemOwnProps, "defaultIsOp
|
|
|
15
15
|
iconSlot?: ReactNode;
|
|
16
16
|
removePadding?: ReactNode;
|
|
17
17
|
};
|
|
18
|
-
export declare type AccordionDisclosureProps = Pick<DisclosureProps, "isOpen" | "onToggle">;
|
|
18
|
+
export declare type AccordionDisclosureProps = Pick<DisclosureProps, "isOpen" | "onToggle" | "onClose">;
|
|
@@ -25,6 +25,8 @@ export declare enum ICON_TYPE {
|
|
|
25
25
|
CALENDAR = "calendar",
|
|
26
26
|
CALCULATOR = "calculator",
|
|
27
27
|
CARET_DOWN = "caret-down",
|
|
28
|
+
CARET_LEFT = "caret-left",
|
|
29
|
+
CARET_RIGHT = "caret-right",
|
|
28
30
|
CARET_UP = "caret-up",
|
|
29
31
|
CHART_LINE = "chart-line",
|
|
30
32
|
CHECK = "check",
|
|
@@ -112,7 +114,8 @@ export declare enum ICON_TYPE {
|
|
|
112
114
|
USER_ASTRONAUT = "user-astronaut",
|
|
113
115
|
USER_PLUS = "user-plus",
|
|
114
116
|
USERS = "users",
|
|
115
|
-
USER_FRIENDS = "user-friends"
|
|
117
|
+
USER_FRIENDS = "user-friends",
|
|
118
|
+
USER_SHIELD = "user-shield"
|
|
116
119
|
}
|
|
117
120
|
export declare enum ICON_STYLE_PREFIX {
|
|
118
121
|
SOLID = "fas",
|
|
@@ -52,6 +52,8 @@ const faBolt_1 = require("@fortawesome/free-solid-svg-icons/faBolt");
|
|
|
52
52
|
const faCalculator_1 = require("@fortawesome/free-solid-svg-icons/faCalculator");
|
|
53
53
|
const faCalendar_1 = require("@fortawesome/free-solid-svg-icons/faCalendar");
|
|
54
54
|
const faCaretDown_1 = require("@fortawesome/free-solid-svg-icons/faCaretDown");
|
|
55
|
+
const faCaretLeft_1 = require("@fortawesome/free-solid-svg-icons/faCaretLeft");
|
|
56
|
+
const faCaretRight_1 = require("@fortawesome/free-solid-svg-icons/faCaretRight");
|
|
55
57
|
const faCaretUp_1 = require("@fortawesome/free-solid-svg-icons/faCaretUp");
|
|
56
58
|
const faChartLine_1 = require("@fortawesome/free-solid-svg-icons/faChartLine");
|
|
57
59
|
const faCheck_1 = require("@fortawesome/free-solid-svg-icons/faCheck");
|
|
@@ -138,12 +140,13 @@ const faUserAstronaut_1 = require("@fortawesome/free-solid-svg-icons/faUserAstro
|
|
|
138
140
|
const faUserPlus_1 = require("@fortawesome/free-solid-svg-icons/faUserPlus");
|
|
139
141
|
const faUsers_1 = require("@fortawesome/free-solid-svg-icons/faUsers");
|
|
140
142
|
const faUserFriends_1 = require("@fortawesome/free-solid-svg-icons/faUserFriends");
|
|
143
|
+
const faUserShield_1 = require("@fortawesome/free-solid-svg-icons/faUserShield");
|
|
141
144
|
const svg_1 = require("./svg");
|
|
142
145
|
const status_1 = require("../../contexts/status");
|
|
143
146
|
const types_1 = require("../../types");
|
|
144
147
|
const utilities_1 = require("../../utilities");
|
|
145
148
|
const cn = utilities_1.bemHOF("Icon");
|
|
146
|
-
fontawesome_svg_core_1.library.add(faArchive_1.faArchive, faArrowDown_1.faArrowDown, faArrowLeft_1.faArrowLeft, faArrowRight_1.faArrowRight, faArrowUp_1.faArrowUp, faBackward_1.faBackward, faBan_1.faBan, faBatteryHalf_1.faBatteryHalf, faBed_1.faBed, faBell_1.faBell, faBolt_1.faBolt, faCalculator_1.faCalculator, faCalendar_1.faCalendar, faCaretDown_1.faCaretDown, faCaretUp_1.faCaretUp, faChartLine_1.faChartLine, faCheck_1.faCheck, faCheckCircle_2.faCheckCircle, faCheckCircle_1.faCheckCircle, faChevronDown_1.faChevronDown, faChevronLeft_1.faChevronLeft, faChevronRight_1.faChevronRight, faChevronUp_1.faChevronUp, faCircle_2.faCircle, faCircleNotch_1.faCircleNotch, faCircle_1.faCircle, faClipboard_1.faClipboard, faClock_1.faClock, faClock_2.faClock, faCog_1.faCog, faColumns_1.faColumns, faCommentAlt_1.faCommentAlt, faCompress_1.faCompress, faCrown_1.faCrown, faEllipsisH_1.faEllipsisH, faEllipsisV_1.faEllipsisV, faEnvelope_1.faEnvelope, faExclamationCircle_1.faExclamationCircle, faExclamationTriangle_1.faExclamationTriangle, faExpand_1.faExpand, faExternalLinkAlt_1.faExternalLinkAlt, faExternalLinkSquareAlt_1.faExternalLinkSquareAlt, faEye_1.faEye, faEyeSlash_1.faEyeSlash, faFastBackward_1.faFastBackward, faFastForward_1.faFastForward, faFileAlt_1.faFileAlt, faFileAlt_2.faFileAlt, faFileImport_1.faFileImport, faFileSignature_1.faFileSignature, faFilter_1.faFilter, faFlag_1.faFlag, faFolder_1.faFolder, faForward_1.faForward, faGripLines_1.faGripLines, faGripLinesVertical_1.faGripLinesVertical, faHashtag_1.faHashtag, faInfoCircle_1.faInfoCircle, faKey_1.faKey, faKeyboard_1.faKeyboard, faLayerGroup_1.faLayerGroup, faLevelUpAlt_1.faLevelUpAlt, faListUl_1.faListUl, faLock_1.faLock, faLongArrowAltRight_1.faLongArrowAltRight, faMagic_1.faMagic, faMapSigns_1.faMapSigns, faMinus_1.faMinus, faMousePointer_1.faMousePointer, faPaperclip_1.faPaperclip, faPause_1.faPause, faPen_1.faPen, faPlay_1.faPlay, faPlus_1.faPlus, faPlusCircle_1.faPlusCircle, faPooStorm_1.faPooStorm, faQuestion_1.faQuestion, faQuestionCircle_2.faQuestionCircle, faQuestionCircle_1.faQuestionCircle, faScroll_1.faScroll, faSearch_1.faSearch, faShareAlt_1.faShareAlt, faShieldAlt_1.faShieldAlt, faSignOutAlt_1.faSignOutAlt, faSignature_1.faSignature, faSlidersH_1.faSlidersH, faSort_1.faSort, faSortDown_1.faSortDown, faSortUp_1.faSortUp, faSpinner_1.faSpinner, faSquare_1.faSquare, faStar_1.faStar, faStar_2.faStar, faSync_1.faSync, faTasks_1.faTasks, faThLarge_1.faThLarge, faThumbsDown_1.faThumbsDown, faThumbsDown_2.faThumbsDown, faThumbsUp_1.faThumbsUp, faThumbsUp_2.faThumbsUp, faTicketAlt_1.faTicketAlt, faTimes_1.faTimes, faTimesCircle_1.faTimesCircle, faTrash_1.faTrash, faUnlock_1.faUnlock, faUser_2.faUser, faUserAstronaut_1.faUserAstronaut, faUserPlus_1.faUserPlus, faUser_1.faUser, faUsers_1.faUsers, faUserFriends_1.faUserFriends);
|
|
149
|
+
fontawesome_svg_core_1.library.add(faArchive_1.faArchive, faArrowDown_1.faArrowDown, faArrowLeft_1.faArrowLeft, faArrowRight_1.faArrowRight, faArrowUp_1.faArrowUp, faBackward_1.faBackward, faBan_1.faBan, faBatteryHalf_1.faBatteryHalf, faBed_1.faBed, faBell_1.faBell, faBolt_1.faBolt, faCalculator_1.faCalculator, faCalendar_1.faCalendar, faCaretDown_1.faCaretDown, faCaretLeft_1.faCaretLeft, faCaretRight_1.faCaretRight, faCaretUp_1.faCaretUp, faChartLine_1.faChartLine, faCheck_1.faCheck, faCheckCircle_2.faCheckCircle, faCheckCircle_1.faCheckCircle, faChevronDown_1.faChevronDown, faChevronLeft_1.faChevronLeft, faChevronRight_1.faChevronRight, faChevronUp_1.faChevronUp, faCircle_2.faCircle, faCircleNotch_1.faCircleNotch, faCircle_1.faCircle, faClipboard_1.faClipboard, faClock_1.faClock, faClock_2.faClock, faCog_1.faCog, faColumns_1.faColumns, faCommentAlt_1.faCommentAlt, faCompress_1.faCompress, faCrown_1.faCrown, faEllipsisH_1.faEllipsisH, faEllipsisV_1.faEllipsisV, faEnvelope_1.faEnvelope, faExclamationCircle_1.faExclamationCircle, faExclamationTriangle_1.faExclamationTriangle, faExpand_1.faExpand, faExternalLinkAlt_1.faExternalLinkAlt, faExternalLinkSquareAlt_1.faExternalLinkSquareAlt, faEye_1.faEye, faEyeSlash_1.faEyeSlash, faFastBackward_1.faFastBackward, faFastForward_1.faFastForward, faFileAlt_1.faFileAlt, faFileAlt_2.faFileAlt, faFileImport_1.faFileImport, faFileSignature_1.faFileSignature, faFilter_1.faFilter, faFlag_1.faFlag, faFolder_1.faFolder, faForward_1.faForward, faGripLines_1.faGripLines, faGripLinesVertical_1.faGripLinesVertical, faHashtag_1.faHashtag, faInfoCircle_1.faInfoCircle, faKey_1.faKey, faKeyboard_1.faKeyboard, faLayerGroup_1.faLayerGroup, faLevelUpAlt_1.faLevelUpAlt, faListUl_1.faListUl, faLock_1.faLock, faLongArrowAltRight_1.faLongArrowAltRight, faMagic_1.faMagic, faMapSigns_1.faMapSigns, faMinus_1.faMinus, faMousePointer_1.faMousePointer, faPaperclip_1.faPaperclip, faPause_1.faPause, faPen_1.faPen, faPlay_1.faPlay, faPlus_1.faPlus, faPlusCircle_1.faPlusCircle, faPooStorm_1.faPooStorm, faQuestion_1.faQuestion, faQuestionCircle_2.faQuestionCircle, faQuestionCircle_1.faQuestionCircle, faScroll_1.faScroll, faSearch_1.faSearch, faShareAlt_1.faShareAlt, faShieldAlt_1.faShieldAlt, faSignOutAlt_1.faSignOutAlt, faSignature_1.faSignature, faSlidersH_1.faSlidersH, faSort_1.faSort, faSortDown_1.faSortDown, faSortUp_1.faSortUp, faSpinner_1.faSpinner, faSquare_1.faSquare, faStar_1.faStar, faStar_2.faStar, faSync_1.faSync, faTasks_1.faTasks, faThLarge_1.faThLarge, faThumbsDown_1.faThumbsDown, faThumbsDown_2.faThumbsDown, faThumbsUp_1.faThumbsUp, faThumbsUp_2.faThumbsUp, faTicketAlt_1.faTicketAlt, faTimes_1.faTimes, faTimesCircle_1.faTimesCircle, faTrash_1.faTrash, faUnlock_1.faUnlock, faUser_2.faUser, faUserAstronaut_1.faUserAstronaut, faUserPlus_1.faUserPlus, faUser_1.faUser, faUsers_1.faUsers, faUserFriends_1.faUserFriends, faUserShield_1.faUserShield);
|
|
147
150
|
var CUSTOM_ICON_TYPE;
|
|
148
151
|
(function (CUSTOM_ICON_TYPE) {
|
|
149
152
|
CUSTOM_ICON_TYPE["ARROW_TO_BOTTOM"] = "arrow-to-bottom";
|
|
@@ -179,6 +182,8 @@ var ICON_TYPE;
|
|
|
179
182
|
ICON_TYPE["CALENDAR"] = "calendar";
|
|
180
183
|
ICON_TYPE["CALCULATOR"] = "calculator";
|
|
181
184
|
ICON_TYPE["CARET_DOWN"] = "caret-down";
|
|
185
|
+
ICON_TYPE["CARET_LEFT"] = "caret-left";
|
|
186
|
+
ICON_TYPE["CARET_RIGHT"] = "caret-right";
|
|
182
187
|
ICON_TYPE["CARET_UP"] = "caret-up";
|
|
183
188
|
ICON_TYPE["CHART_LINE"] = "chart-line";
|
|
184
189
|
ICON_TYPE["CHECK"] = "check";
|
|
@@ -267,6 +272,7 @@ var ICON_TYPE;
|
|
|
267
272
|
ICON_TYPE["USER_PLUS"] = "user-plus";
|
|
268
273
|
ICON_TYPE["USERS"] = "users";
|
|
269
274
|
ICON_TYPE["USER_FRIENDS"] = "user-friends";
|
|
275
|
+
ICON_TYPE["USER_SHIELD"] = "user-shield";
|
|
270
276
|
})(ICON_TYPE = exports.ICON_TYPE || (exports.ICON_TYPE = {}));
|
|
271
277
|
var ICON_STYLE_PREFIX;
|
|
272
278
|
(function (ICON_STYLE_PREFIX) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Kbd = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
const bem_1 = require("../../utilities/bem");
|
|
10
|
+
const cn = bem_1.bemHOF("Kbd");
|
|
11
|
+
const Kbd = ({ className, ...rest }) => {
|
|
12
|
+
return react_1.default.createElement("kbd", Object.assign({ className: classnames_1.default(cn(), className) }, rest));
|
|
13
|
+
};
|
|
14
|
+
exports.Kbd = Kbd;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Kbd";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Kbd"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode, Context, MutableRefObject, Dispatch, SetStateAction, HTMLAttributes, ReactElement, AnchorHTMLAttributes, MouseEvent, ChangeEvent, KeyboardEvent, FocusEvent } from "react";
|
|
1
|
+
import React, { ReactNode, Context, MutableRefObject, Dispatch, SetStateAction, HTMLAttributes, ReactElement, AnchorHTMLAttributes, MouseEvent, ChangeEvent, KeyboardEvent, FocusEvent, InputHTMLAttributes } from "react";
|
|
2
2
|
declare type ScrollSpyContextType = {
|
|
3
3
|
currentIndex: number;
|
|
4
4
|
setCurrentIndex: Dispatch<SetStateAction<number>>;
|
|
@@ -18,6 +18,8 @@ declare type ScrollSpyContextType = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const ScrollSpyContext: Context<ScrollSpyContextType>;
|
|
20
20
|
export declare function useScrollSpyContext(): ScrollSpyContextType;
|
|
21
|
+
export declare type ScrollSpyInputProps = InputHTMLAttributes<HTMLInputElement>;
|
|
22
|
+
export declare const ScrollSpyInput: React.ForwardRefExoticComponent<ScrollSpyInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
21
23
|
export interface ScrollSpyPageProps extends HTMLAttributes<HTMLDivElement> {
|
|
22
24
|
children: ReactElement;
|
|
23
25
|
threshold: number | number[] | undefined;
|
|
@@ -22,11 +22,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ScrollSpyRoot = exports.ScrollSpyAnchor = exports.useScrollSpyAnchorProps = exports.ScrollSpyPage = exports.useScrollSpyPageProps = exports.useScrollSpyContext = exports.ScrollSpyContext = void 0;
|
|
25
|
+
exports.ScrollSpyRoot = exports.ScrollSpyAnchor = exports.useScrollSpyAnchorProps = exports.ScrollSpyPage = exports.useScrollSpyPageProps = exports.ScrollSpyInput = exports.useScrollSpyContext = exports.ScrollSpyContext = void 0;
|
|
26
26
|
const react_1 = __importStar(require("react"));
|
|
27
27
|
const react_merge_refs_1 = __importDefault(require("react-merge-refs"));
|
|
28
28
|
const auto_id_1 = require("@reach/auto-id");
|
|
29
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
30
|
+
const utilities_1 = require("../../utilities");
|
|
29
31
|
const hooks_1 = require("../../hooks");
|
|
32
|
+
const cn = utilities_1.bemHOF("ScrollSpy");
|
|
30
33
|
const defaultRootContext = {
|
|
31
34
|
currentIndex: 0,
|
|
32
35
|
setCurrentIndex: (index) => index,
|
|
@@ -52,6 +55,9 @@ function useScrollSpyContext() {
|
|
|
52
55
|
return context;
|
|
53
56
|
}
|
|
54
57
|
exports.useScrollSpyContext = useScrollSpyContext;
|
|
58
|
+
exports.ScrollSpyInput = react_1.forwardRef(({ className, ...rest }, forwardedRef) => {
|
|
59
|
+
return (react_1.default.createElement("input", Object.assign({ className: classnames_1.default(cn({ e: "input" }), className), ref: forwardedRef, type: "number" }, rest)));
|
|
60
|
+
});
|
|
55
61
|
const useScrollSpyPageProps = ({ index, id } = { index: 0 }) => {
|
|
56
62
|
const { id: rootId } = useScrollSpyContext();
|
|
57
63
|
const pageId = `${rootId}-page-${index + 1}`;
|
package/public/css/styles.css
CHANGED
|
@@ -3974,6 +3974,27 @@ override built-in Image component classes */
|
|
|
3974
3974
|
color: rgb(242 93 84 / var(--tw-text-opacity));
|
|
3975
3975
|
}
|
|
3976
3976
|
|
|
3977
|
+
.ads-Kbd {
|
|
3978
|
+
display: inline-flex;
|
|
3979
|
+
align-items: center;
|
|
3980
|
+
border-radius: 3px;
|
|
3981
|
+
border-width: 1px;
|
|
3982
|
+
--tw-border-opacity: 1;
|
|
3983
|
+
border-color: rgb(222 231 238 / var(--tw-border-opacity));
|
|
3984
|
+
--tw-bg-opacity: 1;
|
|
3985
|
+
background-color: rgb(249 251 252 / var(--tw-bg-opacity));
|
|
3986
|
+
font-size: 12px;
|
|
3987
|
+
line-height: 1;
|
|
3988
|
+
--tw-text-opacity: 1;
|
|
3989
|
+
color: rgb(71 104 125 / var(--tw-text-opacity));
|
|
3990
|
+
|
|
3991
|
+
padding: 2px 5px;
|
|
3992
|
+
}
|
|
3993
|
+
|
|
3994
|
+
.ads-Kbd .svg-inline--fa {
|
|
3995
|
+
width: auto !important;
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3977
3998
|
.ads-Label {
|
|
3978
3999
|
display: block;
|
|
3979
4000
|
font-weight: 500;
|
|
@@ -5264,6 +5285,10 @@ override built-in Image component classes */
|
|
|
5264
5285
|
overflow-y: auto;
|
|
5265
5286
|
}
|
|
5266
5287
|
|
|
5288
|
+
.ads-ScrollSpy-input::-webkit-inner-spin-button {
|
|
5289
|
+
display: none;
|
|
5290
|
+
}
|
|
5291
|
+
|
|
5267
5292
|
.ads-SearchFilter {
|
|
5268
5293
|
position: relative;
|
|
5269
5294
|
display: inline-flex;
|