oolib 2.137.1 → 2.139.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.
Files changed (34) hide show
  1. package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +1 -4
  2. package/dist/components/OKELink/index.d.ts +23 -2
  3. package/dist/components/OKELink/index.js +21 -0
  4. package/dist/components/OKELink/styled.d.ts +15 -9
  5. package/dist/components/OKELink/styled.js +4 -4
  6. package/dist/components/cards/CardContent/index.js +3 -3
  7. package/dist/components/cards/CardEmbed/index.js +3 -3
  8. package/dist/components/cards/ListContent/index.js +3 -3
  9. package/dist/index.d.ts +3 -2
  10. package/dist/index.js +7 -5
  11. package/dist/interfaces/index.d.ts +2 -0
  12. package/dist/stories/v2/components/Button.stories.d.ts +185 -0
  13. package/dist/stories/v2/components/Button.stories.js +171 -0
  14. package/dist/v2/components/Buttons/index.d.ts +45 -0
  15. package/dist/v2/components/Buttons/index.js +180 -0
  16. package/dist/v2/components/Buttons/styled.d.ts +29 -0
  17. package/dist/v2/components/Buttons/styled.js +182 -0
  18. package/dist/v2/themes/utils.d.ts +43 -0
  19. package/dist/v2/themes/utils.js +65 -0
  20. package/package.json +1 -1
  21. package/dist/components/Coachmark/comps/MovingCoachmark/index.d.ts +0 -3
  22. package/dist/components/Coachmark/comps/MovingCoachmark/index.js +0 -68
  23. package/dist/components/Coachmark/comps/MovingCoachmark/styled.d.ts +0 -2
  24. package/dist/components/Coachmark/comps/MovingCoachmark/styled.js +0 -45
  25. package/dist/components/Coachmark/comps/MovingCoachmark/utils/index.d.ts +0 -1
  26. package/dist/components/Coachmark/comps/MovingCoachmark/utils/index.js +0 -57
  27. package/dist/components/Coachmark/config.d.ts +0 -31
  28. package/dist/components/Coachmark/config.js +0 -61
  29. package/dist/components/Coachmark/index.d.ts +0 -4
  30. package/dist/components/Coachmark/index.js +0 -74
  31. package/dist/components/Coachmark/styled.d.ts +0 -1
  32. package/dist/components/Coachmark/styled.js +0 -37
  33. package/dist/components/Coachmark/utils/index.d.ts +0 -13
  34. package/dist/components/Coachmark/utils/index.js +0 -70
@@ -57,10 +57,7 @@ var OptionsAnimateWrapper = function (_a) {
57
57
  });
58
58
  }, [options.length]);
59
59
  return (react_1.default.createElement(styled_1.StyledOptionsAnimateWrapper, { invert: invert, isOpen: showOptions, width: width, openHeight: openHeight, style: __assign(__assign(__assign({}, (lightboxStyle || {})), { zIndex: 100000 }), (fixPos
60
- ? __assign({ position: "fixed", top: "".concat(fixPos.y -
61
- (yOrientation === "top" ? (selectCompRect === null || selectCompRect === void 0 ? void 0 : selectCompRect.height) || 0 : 0), "px"), left: "".concat(fixPos.x, "px") }, (yOrientation === "top"
62
- ? { transform: "translateY(-100%)" }
63
- : {})) : __assign(__assign({ position: "absolute" }, (optionsAnchor ? (_b = {}, _b[optionsAnchor] = 0, _b) : { left: 0 })), (yOrientation === "bottom"
60
+ ? __assign({ position: "fixed", top: "".concat(fixPos.y - (yOrientation === "top" ? (selectCompRect === null || selectCompRect === void 0 ? void 0 : selectCompRect.height) || 0 : 0), "px"), left: "".concat(fixPos.x, "px") }, (yOrientation === "top" ? { transform: "translateY(-100%)" } : {})) : __assign(__assign({ position: "absolute" }, (optionsAnchor ? (_b = {}, _b[optionsAnchor] = 0, _b) : { left: 0 })), (yOrientation === "bottom"
64
61
  ? { bottom: 0, transform: "translateY(100%)" }
65
62
  : { top: 0, transform: "translateY(-100%)" })))) }, children));
66
63
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { FunctionComponent } from 'react';
2
2
  import { DisplayIconProps } from '../../utils/comps/DisplayIcon';
3
3
  import { icons } from '../../icons';
4
4
  export interface OKELinkProps {
@@ -18,4 +18,25 @@ export interface OKELinkProps {
18
18
  style?: React.CSSProperties;
19
19
  avatar?: any;
20
20
  }
21
- export declare const OKELink: React.FC<OKELinkProps>;
21
+ /**
22
+ * @component Renders a link component with customizable text, styling, and behavior.
23
+ *
24
+ * - The component props object containing the following properties:
25
+ * @prop {string} [to]: The URL to link to.
26
+ * @prop {string} [link]: An external URL to link to.
27
+ * @prop {(e: React.MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void} [onClick]: A callback function to execute when the link is clicked.
28
+ * @prop {keyof typeof icons} [icon]: An icon to display before the text.
29
+ * @prop {DisplayIconProps['weight']} [iconWeight]: The weight of the icon font. Defaults to "regular".
30
+ * @prop {keyof typeof icons} [iconAfter]: An icon to display after the text.
31
+ * @prop {string} [text]: The text to display in the link.
32
+ * @prop {React.ReactNode} [children]: The content to be rendered inside the link.
33
+ * @prop {boolean} [invertUnderline]: A boolean indicating whether to invert the underline style of the link. Defaults to false.
34
+ * @prop {string} [color]: A string indicating the color of the link. Defaults to the primary color of the theme.
35
+ * @prop {boolean} [invert]: A boolean indicating whether to invert the colors of the link. Defaults to false.
36
+ * @prop {boolean} [disabled]: A boolean indicating whether the link is disabled. Defaults to false.
37
+ * @prop {string} [className]: A string indicating the CSS class name to apply to the link.
38
+ * @prop {React.CSSProperties} [style]: Additional CSS styles to apply to the link.
39
+ * @prop {ProfileImageInputProps['value']} [avatar]: An avatar to display in the link.
40
+ * @return {ReactElement} The rendered link component.
41
+ */
42
+ export declare const OKELink: FunctionComponent<OKELinkProps>;
@@ -43,6 +43,27 @@ var injectHttps_1 = require("../../utils/injectHttps");
43
43
  var utilsOolib_1 = require("../../utilsOolib");
44
44
  var styled_1 = require("./styled");
45
45
  var ProfileImageInput_1 = require("../ImageInput/derivedComps/ProfileImageInput");
46
+ /**
47
+ * @component Renders a link component with customizable text, styling, and behavior.
48
+ *
49
+ * - The component props object containing the following properties:
50
+ * @prop {string} [to]: The URL to link to.
51
+ * @prop {string} [link]: An external URL to link to.
52
+ * @prop {(e: React.MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void} [onClick]: A callback function to execute when the link is clicked.
53
+ * @prop {keyof typeof icons} [icon]: An icon to display before the text.
54
+ * @prop {DisplayIconProps['weight']} [iconWeight]: The weight of the icon font. Defaults to "regular".
55
+ * @prop {keyof typeof icons} [iconAfter]: An icon to display after the text.
56
+ * @prop {string} [text]: The text to display in the link.
57
+ * @prop {React.ReactNode} [children]: The content to be rendered inside the link.
58
+ * @prop {boolean} [invertUnderline]: A boolean indicating whether to invert the underline style of the link. Defaults to false.
59
+ * @prop {string} [color]: A string indicating the color of the link. Defaults to the primary color of the theme.
60
+ * @prop {boolean} [invert]: A boolean indicating whether to invert the colors of the link. Defaults to false.
61
+ * @prop {boolean} [disabled]: A boolean indicating whether the link is disabled. Defaults to false.
62
+ * @prop {string} [className]: A string indicating the CSS class name to apply to the link.
63
+ * @prop {React.CSSProperties} [style]: Additional CSS styles to apply to the link.
64
+ * @prop {ProfileImageInputProps['value']} [avatar]: An avatar to display in the link.
65
+ * @return {ReactElement} The rendered link component.
66
+ */
46
67
  var OKELink = function (_a) {
47
68
  var _to = _a.to, link = _a.link, onClick = _a.onClick, icon = _a.icon, iconWeight = _a.iconWeight, iconAfter = _a.iconAfter, text = _a.text, children = _a.children, invertUnderline = _a.invertUnderline, color = _a.color, invert = _a.invert, disabled = _a.disabled, className = _a.className, style = _a.style, avatar = _a.avatar;
48
69
  var to = link || _to;
@@ -1,9 +1,15 @@
1
- export function genColor({ color, theme, invert, disabled }: {
2
- color: any;
3
- theme: any;
4
- invert: any;
5
- disabled: any;
6
- }): any;
7
- export const styledOKELinkCSS: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
8
- export const StyledLink: import("styled-components").StyledComponent<"a", any, {}, never>;
9
- export const StyledLinkText: import("styled-components").StyledComponent<"span", any, {}, never>;
1
+ import { OKFTheme } from "../../interfaces";
2
+ export interface ColorProps {
3
+ color?: string;
4
+ theme?: OKFTheme;
5
+ invert?: boolean;
6
+ disabled?: boolean;
7
+ }
8
+ export declare const genColor: ({ color, theme, invert, disabled }: ColorProps) => string;
9
+ interface StyledLinkProps extends ColorProps {
10
+ invertUnderline?: boolean;
11
+ }
12
+ export declare const styledOKELinkCSS: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<StyledLinkProps, any>>;
13
+ export declare const StyledLink: import("styled-components").StyledComponent<"a", any, StyledLinkProps, never>;
14
+ export declare const StyledLinkText: import("styled-components").StyledComponent<"span", any, {}, never>;
15
+ export {};
@@ -43,8 +43,8 @@ var genColor = function (_a) {
43
43
  : (0, utilsOolib_1.getPrimaryColorText)(theme === null || theme === void 0 ? void 0 : theme.colors);
44
44
  };
45
45
  exports.genColor = genColor;
46
- //separated out this way so we can use it in LexicalTextEditor's StyledEditorWrapperLex
47
- exports.styledOKELinkCSS = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\ncursor: ", ";\n display: inline-flex;\n gap: 0.7rem;\n align-items: center;\n max-width: 100%;\n text-decoration: none;\n position: relative;\n color: ", ";\n\n &::after{\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n width: ", ";\n height: ", ";\n pointer-events: ", ";\n ", ";\n background-color: ", ";\n }\n\n &:hover{\n color: ", ";\n &::after{ width: ", "; }\n }\n"], ["\ncursor: ", ";\n display: inline-flex;\n gap: 0.7rem;\n align-items: center;\n max-width: 100%;\n text-decoration: none;\n position: relative;\n color: ", ";\n\n &::after{\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n width: ", ";\n height: ", ";\n pointer-events: ", ";\n ", ";\n background-color: ", ";\n }\n\n &:hover{\n color: ", ";\n &::after{ width: ", "; }\n }\n"])), function (_a) {
46
+ // Separated out this way so we can use it in LexicalTextEditor's StyledEditorWrapperLex
47
+ exports.styledOKELinkCSS = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n gap: 0.7rem;\n align-items: center;\n max-width: 100%;\n text-decoration: none;\n position: relative;\n color: ", ";\n\n &::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n width: ", ";\n height: ", ";\n pointer-events: ", ";\n ", ";\n background-color: ", ";\n }\n\n &:hover {\n color: ", ";\n &::after { width: ", "; }\n }\n"], ["\n cursor: ", ";\n display: inline-flex;\n gap: 0.7rem;\n align-items: center;\n max-width: 100%;\n text-decoration: none;\n position: relative;\n color: ", ";\n\n &::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n width: ", ";\n height: ", ";\n pointer-events: ", ";\n ", ";\n background-color: ", ";\n }\n\n &:hover {\n color: ", ";\n &::after { width: ", "; }\n }\n"])), function (_a) {
48
48
  var disabled = _a.disabled;
49
49
  return !disabled ? 'pointer' : 'not-allowed';
50
50
  }, exports.genColor, function (_a) {
@@ -60,6 +60,6 @@ exports.styledOKELinkCSS = (0, styled_components_1.css)(templateObject_1 || (tem
60
60
  var invertUnderline = _a.invertUnderline;
61
61
  return invertUnderline ? '100%' : 0;
62
62
  });
63
- exports.StyledLink = styled_components_1.default.a(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), exports.styledOKELinkCSS);
64
- exports.StyledLinkText = styled_components_1.default.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n max-width: 100%;\n ", ";\n"], ["\n max-width: 100%;\n ", ";\n"])), mixins_1.ellipsis);
63
+ exports.StyledLink = styled_components_1.default.a(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), exports.styledOKELinkCSS);
64
+ exports.StyledLinkText = styled_components_1.default.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n max-width: 100%;\n ", ";\n"], ["\n max-width: 100%;\n ", ";\n"])), mixins_1.ellipsis);
65
65
  var templateObject_1, templateObject_2, templateObject_3;
@@ -68,9 +68,9 @@ var CardContent = function (_a) {
68
68
  showEmbedSection && (react_1.default.createElement(styled_2.StyledEmbedSection, null,
69
69
  !(0, mediaDataExists_1.imageDataExists)(image) && !(0, mediaDataExists_1.videoDataExists)(video) &&
70
70
  react_1.default.createElement(CardPlaceholder_1.CardPlaceholder, null),
71
- (0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement("div", { style: { width: "100%", position: 'relative' } },
71
+ (0, mediaDataExists_1.imageDataExists)(image) && (react_1.default.createElement("div", { style: { width: "100%" } }, react_1.default.createElement(ImageInput_1.ImageInput, { value: image, aspectRatio: "5/3", readOnly: true, defaultImageSpread: "cover", enableCaptions: false, disableImageBorder: true }))),
72
+ (0, mediaDataExists_1.videoDataExists)(video) && !(0, mediaDataExists_1.imageDataExists)(image) ? (react_1.default.createElement("div", { style: { width: "100%", position: 'relative' } },
72
73
  react_1.default.createElement(VideoInput_1.default, { value: video, readOnly: true, light: true }),
73
- react_1.default.createElement("div", { style: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' } }))),
74
- (0, mediaDataExists_1.imageDataExists)(image) && !(0, mediaDataExists_1.videoDataExists)(video) ? (react_1.default.createElement("div", { style: { width: "100%" } }, react_1.default.createElement(ImageInput_1.ImageInput, { value: image, aspectRatio: "5/3", readOnly: true, defaultImageSpread: "cover", enableCaptions: false, disableImageBorder: true }))) : null)))));
74
+ react_1.default.createElement("div", { style: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' } }))) : null)))));
75
75
  };
76
76
  exports.CardContent = CardContent;
@@ -80,7 +80,7 @@ var CardEmbed = function (_a) {
80
80
  height: "100%",
81
81
  width: "auto",
82
82
  } }))),
83
- (0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement(styled_2.StyledMediaContainer, null,
83
+ (0, mediaDataExists_1.videoDataExists)(video) && !(0, mediaDataExists_1.imageDataExists)(image) ? (react_1.default.createElement(styled_2.StyledMediaContainer, null,
84
84
  react_1.default.createElement("div", { style: {
85
85
  position: "relative",
86
86
  height: "100%",
@@ -93,8 +93,8 @@ var CardEmbed = function (_a) {
93
93
  left: 0,
94
94
  width: "100%",
95
95
  height: "100%",
96
- } })))),
97
- (0, mediaDataExists_1.imageDataExists)(image) > 0 && !(0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement(styled_2.StyledMediaContainer, null,
96
+ } })))) : null,
97
+ (0, mediaDataExists_1.imageDataExists)(image) && (react_1.default.createElement(styled_2.StyledMediaContainer, null,
98
98
  react_1.default.createElement(ImageInput_1.ImageInput, { stretchToFullHeight: true, value: image, aspectRatio: imageAspectRatio, readOnly: true, enableCaptions: false, disableImageBorder: true, defaultImageSpread: "cover" }))))))));
99
99
  };
100
100
  exports.CardEmbed = CardEmbed;
@@ -62,7 +62,7 @@ var ListContent = function (_a) {
62
62
  mediaConfigExists && react_1.default.createElement(react_1.default.Fragment, null,
63
63
  !(0, mediaDataExists_1.imageDataExists)(image) && !(0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
64
64
  react_1.default.createElement(CardPlaceholder_1.CardPlaceholder, { style: { height: "100%", width: "auto" } }))),
65
- (0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
65
+ (0, mediaDataExists_1.videoDataExists)(video) && !(0, mediaDataExists_1.imageDataExists)(image) ? (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
66
66
  react_1.default.createElement(styled_js_1.StyledVideoWrapper, null,
67
67
  react_1.default.createElement(VideoInput_1.default, { value: video, readOnly: true, light: true, height: "100%" }),
68
68
  react_1.default.createElement("div", { style: {
@@ -71,8 +71,8 @@ var ListContent = function (_a) {
71
71
  left: 0,
72
72
  width: "100%",
73
73
  height: "100%",
74
- } })))),
75
- (0, mediaDataExists_1.imageDataExists)(image) > 0 && !(0, mediaDataExists_1.videoDataExists)(video) && (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
74
+ } })))) : null,
75
+ (0, mediaDataExists_1.imageDataExists)(image) && (react_1.default.createElement(styled_js_1.StyledMediaMask, null,
76
76
  // <div
77
77
  // // style={{
78
78
  // // width: "14rem",
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export { GlobalStyles } from "./globalStyles";
2
2
  export * from "./themes/mixins";
3
3
  export * from "./components/Typo";
4
- export * from "./v2/components/Typo2";
5
4
  export * from "./globalStyles/globalVariables";
6
5
  export * from "./components/Buttons";
7
6
  export * from "./components/Tags";
@@ -17,8 +16,9 @@ export * from "./components/RadioAndCheckbox";
17
16
  export * from "./components/Margins";
18
17
  export * from "./components/Paddings";
19
18
  export * from "./utils/_EXPORTS";
19
+ export * from "./v2/components/Buttons";
20
+ export * from "./v2/components/Typo2";
20
21
  export { colors } from "./themes";
21
- export { colors as colors2 } from "./v2/themes";
22
22
  export { icons } from "./icons";
23
23
  export { Section } from "./components/Section";
24
24
  export { UserRoleBadge } from "./components/UserRoleBadge";
@@ -70,6 +70,7 @@ export { ModalConfirmAction } from "./components/Modals/derivedComps/ModalConfir
70
70
  export { SimpleTable } from "./components/SimpleTable";
71
71
  export { styledOKELinkCSS } from "./components/OKELink/styled";
72
72
  export { default as TableCellResizerPlugin } from "./components/Lexical/Plugins/TableCellResizer";
73
+ export { colors as colors2 } from "./v2/themes";
73
74
  export { LoaderCircle, ProgressBar, LoaderCircle as Loader, LoaderOverlay } from "./components/LoadersAndProgress";
74
75
  export { BannerAlert, BannerInfo } from "./components/Banners";
75
76
  export { BannerContext, useBannerContext, BannerProvider } from "./components/Banners/bannerContext";
package/dist/index.js CHANGED
@@ -17,8 +17,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.HintsProvider = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.ListContent = exports.CardContent = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.BarChart = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentBarChart = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors2 = exports.colors = exports.GlobalStyles = void 0;
21
- exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = exports.BannerInfo = exports.BannerAlert = exports.GroupQuestionsInputSingle = exports.ResourceInput = exports.IFrameInput = exports.PDFInput = void 0;
20
+ exports.PDFInput = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.HintsProvider = exports.genTagComp = exports.generateOptions = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.ListContent = exports.CardContent = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.BarChart = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentBarChart = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.icons = exports.colors = exports.GlobalStyles = void 0;
21
+ exports.colors2 = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = exports.BannerInfo = exports.BannerAlert = exports.GroupQuestionsInputSingle = exports.ResourceInput = exports.IFrameInput = void 0;
22
22
  //css and styling related ( styled-components )
23
23
  var globalStyles_1 = require("./globalStyles");
24
24
  Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
@@ -26,12 +26,9 @@ __exportStar(require("./themes/mixins"), exports);
26
26
  //base style guide : i.e colors, icons, typo
27
27
  var themes_1 = require("./themes");
28
28
  Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return themes_1.colors; } });
29
- var themes_2 = require("./v2/themes");
30
- Object.defineProperty(exports, "colors2", { enumerable: true, get: function () { return themes_2.colors; } });
31
29
  var icons_1 = require("./icons");
32
30
  Object.defineProperty(exports, "icons", { enumerable: true, get: function () { return icons_1.icons; } });
33
31
  __exportStar(require("./components/Typo"), exports);
34
- __exportStar(require("./v2/components/Typo2"), exports);
35
32
  __exportStar(require("./globalStyles/globalVariables"), exports);
36
33
  ////components
37
34
  var LoadersAndProgress_1 = require("./components/LoadersAndProgress");
@@ -176,3 +173,8 @@ Object.defineProperty(exports, "styledOKELinkCSS", { enumerable: true, get: func
176
173
  // lexical
177
174
  var TableCellResizer_1 = require("./components/Lexical/Plugins/TableCellResizer");
178
175
  Object.defineProperty(exports, "TableCellResizerPlugin", { enumerable: true, get: function () { return __importDefault(TableCellResizer_1).default; } });
176
+ /////// V2 components /themes
177
+ __exportStar(require("./v2/components/Buttons"), exports);
178
+ __exportStar(require("./v2/components/Typo2"), exports);
179
+ var themes_2 = require("./v2/themes");
180
+ Object.defineProperty(exports, "colors2", { enumerable: true, get: function () { return themes_2.colors; } });
@@ -1,6 +1,8 @@
1
1
  import { ReactNode } from "react";
2
2
  import { DefaultTheme } from "styled-components";
3
+ import { ColorsType } from "../themes/colors";
3
4
  export interface OKFTheme extends DefaultTheme {
4
5
  ENV?: string;
5
6
  localize?: (text: ReactNode) => ReactNode;
7
+ colors?: ColorsType;
6
8
  }
@@ -0,0 +1,185 @@
1
+ /// <reference types="mdx" />
2
+ declare namespace _default {
3
+ let title: string;
4
+ namespace argTypes {
5
+ namespace size {
6
+ let name: string;
7
+ let options: string[];
8
+ namespace mapping {
9
+ let Small: string;
10
+ let Medium: string;
11
+ }
12
+ namespace control {
13
+ let type: string;
14
+ }
15
+ }
16
+ namespace icon {
17
+ let name_1: string;
18
+ export { name_1 as name };
19
+ export { availableIcons as options };
20
+ export namespace control_1 {
21
+ let type_1: string;
22
+ export { type_1 as type };
23
+ }
24
+ export { control_1 as control };
25
+ export let defaultValue: string;
26
+ }
27
+ namespace iconAfter {
28
+ let name_2: string;
29
+ export { name_2 as name };
30
+ export { availableIcons as options };
31
+ export namespace control_2 {
32
+ let type_2: string;
33
+ export { type_2 as type };
34
+ }
35
+ export { control_2 as control };
36
+ }
37
+ namespace iconSize {
38
+ let name_3: string;
39
+ export { name_3 as name };
40
+ let options_1: string[];
41
+ export { options_1 as options };
42
+ export namespace mapping_1 {
43
+ let Small_1: string;
44
+ export { Small_1 as Small };
45
+ let Medium_1: string;
46
+ export { Medium_1 as Medium };
47
+ }
48
+ export { mapping_1 as mapping };
49
+ export namespace control_3 {
50
+ let type_3: string;
51
+ export { type_3 as type };
52
+ }
53
+ export { control_3 as control };
54
+ }
55
+ namespace iconColor {
56
+ let name_4: string;
57
+ export { name_4 as name };
58
+ export { availableColors as options };
59
+ export namespace control_4 {
60
+ let type_4: string;
61
+ export { type_4 as type };
62
+ }
63
+ export { control_4 as control };
64
+ }
65
+ namespace composition {
66
+ let name_5: string;
67
+ export { name_5 as name };
68
+ let options_2: string[];
69
+ export { options_2 as options };
70
+ export namespace control_5 {
71
+ let type_5: string;
72
+ export { type_5 as type };
73
+ }
74
+ export { control_5 as control };
75
+ let defaultValue_1: string;
76
+ export { defaultValue_1 as defaultValue };
77
+ }
78
+ namespace width {
79
+ let name_6: string;
80
+ export { name_6 as name };
81
+ export namespace control_6 {
82
+ let type_6: string;
83
+ export { type_6 as type };
84
+ }
85
+ export { control_6 as control };
86
+ }
87
+ namespace variant {
88
+ let name_7: string;
89
+ export { name_7 as name };
90
+ export namespace control_7 {
91
+ let type_7: string;
92
+ export { type_7 as type };
93
+ }
94
+ export { control_7 as control };
95
+ let options_3: string[];
96
+ export { options_3 as options };
97
+ let defaultValue_2: string;
98
+ export { defaultValue_2 as defaultValue };
99
+ }
100
+ namespace children {
101
+ let name_8: string;
102
+ export { name_8 as name };
103
+ }
104
+ namespace invert {
105
+ let name_9: string;
106
+ export { name_9 as name };
107
+ }
108
+ namespace disabled {
109
+ let name_10: string;
110
+ export { name_10 as name };
111
+ }
112
+ }
113
+ namespace args {
114
+ let size_1: string;
115
+ export { size_1 as size };
116
+ let variant_1: string;
117
+ export { variant_1 as variant };
118
+ let composition_1: string;
119
+ export { composition_1 as composition };
120
+ let children_1: string;
121
+ export { children_1 as children };
122
+ let icon_1: string;
123
+ export { icon_1 as icon };
124
+ let iconAfter_1: any;
125
+ export { iconAfter_1 as iconAfter };
126
+ let iconSize_1: string;
127
+ export { iconSize_1 as iconSize };
128
+ let iconColor_1: any;
129
+ export { iconColor_1 as iconColor };
130
+ let disabled_1: boolean;
131
+ export { disabled_1 as disabled };
132
+ let invert_1: boolean;
133
+ export { invert_1 as invert };
134
+ }
135
+ namespace parameters {
136
+ namespace docs {
137
+ export { ButtonDocs as page };
138
+ }
139
+ }
140
+ }
141
+ export default _default;
142
+ export function Button_Primary(args: any): React.JSX.Element;
143
+ export namespace Button_Primary {
144
+ export namespace parameters_1 {
145
+ namespace controls {
146
+ let exclude: string[];
147
+ }
148
+ }
149
+ export { parameters_1 as parameters };
150
+ }
151
+ export function Button_Secondary(args: any): React.JSX.Element;
152
+ export namespace Button_Secondary {
153
+ export namespace parameters_2 {
154
+ export namespace controls_1 {
155
+ let exclude_1: string[];
156
+ export { exclude_1 as exclude };
157
+ }
158
+ export { controls_1 as controls };
159
+ }
160
+ export { parameters_2 as parameters };
161
+ export namespace args_1 {
162
+ let active: boolean;
163
+ }
164
+ export { args_1 as args };
165
+ }
166
+ export function Button_Ghost(args: any): React.JSX.Element;
167
+ export namespace Button_Ghost {
168
+ export namespace args_2 {
169
+ let active_1: boolean;
170
+ export { active_1 as active };
171
+ }
172
+ export { args_2 as args };
173
+ export namespace parameters_3 {
174
+ export namespace controls_2 {
175
+ let exclude_2: string[];
176
+ export { exclude_2 as exclude };
177
+ }
178
+ export { controls_2 as controls };
179
+ }
180
+ export { parameters_3 as parameters };
181
+ }
182
+ declare const availableIcons: string[];
183
+ declare const availableColors: string[];
184
+ import ButtonDocs from "../../Oolib/components/Buttons.mdx";
185
+ import React from "react";
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
+ if (ar || !(i in from)) {
16
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
+ ar[i] = from[i];
18
+ }
19
+ }
20
+ return to.concat(ar || Array.prototype.slice.call(from));
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Button_Ghost = exports.Button_Secondary = exports.Button_Primary = void 0;
27
+ var react_1 = __importDefault(require("react"));
28
+ var Buttons_1 = require("../../../v2/components/Buttons");
29
+ var Buttons_mdx_1 = __importDefault(require("../../Oolib/components/Buttons.mdx"));
30
+ var icons_1 = require("../../../icons");
31
+ var themes_1 = require("../../../themes");
32
+ var availableIcons = __spreadArray([undefined], Object.keys(icons_1.icons).sort(), true);
33
+ var availableColors = __spreadArray([undefined], Object.keys(themes_1.colors).sort(), true);
34
+ exports.default = {
35
+ title: "Oolib V 2.0/components/Buttons",
36
+ argTypes: {
37
+ size: {
38
+ name: "Button Size",
39
+ options: ["Small", "Medium"],
40
+ mapping: {
41
+ Small: "S",
42
+ Medium: "M",
43
+ },
44
+ control: { type: "inline-radio" },
45
+ },
46
+ icon: {
47
+ name: "Icon Before",
48
+ options: availableIcons,
49
+ control: { type: "select" },
50
+ defaultValue: "PencilSimple",
51
+ },
52
+ iconAfter: {
53
+ name: "Icon After",
54
+ options: availableIcons,
55
+ control: { type: "select" },
56
+ },
57
+ iconSize: {
58
+ name: "Icon Size",
59
+ options: ["Small", "Medium"],
60
+ mapping: {
61
+ Small: "S",
62
+ Medium: "M",
63
+ },
64
+ control: { type: "inline-radio" },
65
+ },
66
+ iconColor: {
67
+ name: "Icon Color",
68
+ options: availableColors,
69
+ control: { type: "select" },
70
+ },
71
+ composition: {
72
+ name: "Button Compostion",
73
+ options: ["Default", "Text-only", "Icon-only"],
74
+ control: { type: "select" },
75
+ defaultValue: "Default",
76
+ },
77
+ width: {
78
+ name: "Width",
79
+ control: { type: "text" }
80
+ },
81
+ variant: {
82
+ name: "Button Type",
83
+ control: { type: "select" },
84
+ options: ["secondary", "primary", "ghost", "custom"],
85
+ defaultValue: "secondary",
86
+ },
87
+ children: {
88
+ name: "Text",
89
+ },
90
+ invert: {
91
+ name: "Invert",
92
+ },
93
+ disabled: {
94
+ name: "Disabled",
95
+ },
96
+ },
97
+ args: {
98
+ size: "Small",
99
+ variant: "secondary",
100
+ composition: "Default",
101
+ children: "Text",
102
+ icon: "PencilSimple",
103
+ iconAfter: undefined,
104
+ iconSize: "Small",
105
+ iconColor: undefined,
106
+ disabled: false,
107
+ invert: false,
108
+ },
109
+ parameters: {
110
+ docs: {
111
+ page: Buttons_mdx_1.default,
112
+ },
113
+ },
114
+ };
115
+ var GenButtonStory = function (_a) {
116
+ var args = _a.args, Comp = _a.Comp;
117
+ console.log(args.composition);
118
+ args[args["size"]] = true;
119
+ args[args["state"]] = true;
120
+ args.iconColor = themes_1.colors[args.iconColor];
121
+ args["onClick"] = function () { return console.log("clicked"); };
122
+ if (args.composition === "Text-only") {
123
+ delete args.icon;
124
+ delete args.iconAfter;
125
+ }
126
+ if (args.composition === "Icon-only") {
127
+ delete args["children"];
128
+ }
129
+ args["theme"] = {
130
+ colors: {
131
+ primaryColor40: "#addbff",
132
+ primaryColor100: "#33a4ff",
133
+ primaryColor10: "#EBF6FF",
134
+ primaryColorText: "#0071CC",
135
+ },
136
+ };
137
+ return (react_1.default.createElement("div", { style: {
138
+ backgroundColor: args.invert ? "#383838" : "",
139
+ padding: "20px",
140
+ } },
141
+ react_1.default.createElement(Comp, __assign({}, args))));
142
+ };
143
+ var Button_Primary = function (args) { return (react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonPrimary })); };
144
+ exports.Button_Primary = Button_Primary;
145
+ exports.Button_Primary.parameters = { controls: { exclude: ["variant", "color"] } };
146
+ var Button_Secondary = function (args) { return (react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonSecondary })); };
147
+ exports.Button_Secondary = Button_Secondary;
148
+ exports.Button_Secondary.parameters = { controls: { exclude: ["variant", "color"] } };
149
+ exports.Button_Secondary.args = {
150
+ active: false,
151
+ };
152
+ var Button_Ghost = function (args) { return (react_1.default.createElement(GenButtonStory, { args: args, Comp: Buttons_1.ButtonGhost })); };
153
+ exports.Button_Ghost = Button_Ghost;
154
+ exports.Button_Ghost.args = {
155
+ active: false,
156
+ };
157
+ exports.Button_Ghost.parameters = { controls: { exclude: ["variant"] } };
158
+ // export const Button_Custom = (args) => (
159
+ // <GenButtonStory args={args} Comp={ButtonCustom} />
160
+ // );
161
+ // Button_Custom.parameters = { controls: { exclude: ["variant", "color"] } };
162
+ // export const Google_Login = (args) => (
163
+ // <GenButtonStory args={args} Comp={GoogleLogin} />
164
+ // );
165
+ // Google_Login.parameters = {
166
+ // controls: { exclude: ["variant", "color", "iconOnly", "icon + text"] },
167
+ // };
168
+ // export const Upload_Button = (args) => (
169
+ // <GenButtonStory args={{ ...args, children: "Upload" }} Comp={UploadButton} />
170
+ // );
171
+ // Upload_Button.parameters = { controls: { exclude: ["color"] } };