@elliemae/ds-toolbar-v2 3.28.1-rc.2 → 3.29.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSToolbarItemV2.js +4 -1
- package/dist/cjs/DSToolbarItemV2.js.map +2 -2
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/DSToolbarItemV2.js +4 -1
- package/dist/esm/DSToolbarItemV2.js.map +2 -2
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/DSToolbarItemV2.d.ts +6 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/react-desc-prop-types.d.ts +9 -7
- package/package.json +7 -7
|
@@ -44,7 +44,10 @@ var import_useToolbarItemHandlers = require("./useToolbarItemHandlers.js");
|
|
|
44
44
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
45
45
|
var import_DSToolbarDefinitions = require("./DSToolbarDefinitions.js");
|
|
46
46
|
const DSToolbarItemV2 = (props) => {
|
|
47
|
-
const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
|
|
47
|
+
const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
|
|
48
|
+
props,
|
|
49
|
+
import_react_desc_prop_types.defaultItemProps
|
|
50
|
+
);
|
|
48
51
|
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_react_desc_prop_types.DSToolbarItemV2Schema, import_DSToolbarDefinitions.DSToolbarItemName);
|
|
49
52
|
const { render: ComponentRenderer, isFirstItem } = propsWithDefaults;
|
|
50
53
|
const { id: providedId, ...restGlobals } = (0, import_lodash.omit)((0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefaults), ["rows", "cols", "wrap"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSToolbarItemV2.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { omit } from 'lodash';\nimport { DSToolbarV2Context } from './DSToolbarV2Context.js';\nimport { StyledToolbarItem } from './styled.js';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers.js';\nimport { defaultItemProps, DSToolbarItemV2Schema } from './react-desc-prop-types.js';\nimport type { DSToolbarItemT } from './react-desc-prop-types.js';\nimport { DSToolbarItemName } from './DSToolbarDefinitions.js';\nconst DSToolbarItemV2
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { omit } from 'lodash';\nimport { DSToolbarV2Context } from './DSToolbarV2Context.js';\nimport { StyledToolbarItem } from './styled.js';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers.js';\nimport { defaultItemProps, DSToolbarItemV2Schema } from './react-desc-prop-types.js';\nimport type { DSToolbarItemT } from './react-desc-prop-types.js';\nimport { DSToolbarItemName } from './DSToolbarDefinitions.js';\nconst DSToolbarItemV2 = <T extends HTMLElement = HTMLElement>(props: DSToolbarItemT.Props<T>) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSToolbarItemT.Props<T>>(\n props,\n defaultItemProps as unknown as DSToolbarItemT.Props<T>,\n );\n\n useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarItemV2Schema, DSToolbarItemName);\n const { render: ComponentRenderer, isFirstItem } = propsWithDefaults;\n const { id: providedId, ...restGlobals } = omit(useGetGlobalAttributes(propsWithDefaults), ['rows', 'cols', 'wrap']);\n const { registerReference, dndDraggingItem } = useContext(DSToolbarV2Context);\n const ref: AnyRef<T> = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = providedId ?? `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref, providedId]);\n\n const tabIndex = useMemo(\n () => (dndDraggingItem === toolbarItemId || (!dndDraggingItem && isFirstItem) ? 0 : -1),\n [dndDraggingItem, isFirstItem, toolbarItemId],\n );\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n return (\n <StyledToolbarItem\n id={toolbarItemId}\n data-testid=\"ds-toolbar-item\"\n className=\"ds-toolbar-item\"\n {...handlers}\n {...restGlobals}\n >\n <ComponentRenderer innerRef={ref} tabIndex={tabIndex} />\n </StyledToolbarItem>\n );\n};\n\nDSToolbarItemV2.propTypes = DSToolbarItemV2Schema;\n\nDSToolbarItemV2.displayName = DSToolbarItemName;\nconst DSToolbarItemV2WithSchema = describe(DSToolbarItemV2).description('Toolbar Item');\nDSToolbarItemV2WithSchema.propTypes = DSToolbarItemV2Schema;\n\nexport { DSToolbarItemV2, DSToolbarItemV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgDjB;AA/CN,mBAAmD;AACnD,8BAKO;AACP,iBAAoB;AACpB,oBAAqB;AACrB,gCAAmC;AACnC,oBAAkC;AAClC,oCAAuC;AACvC,mCAAwD;AAExD,kCAAkC;AAClC,MAAM,kBAAkB,CAAsC,UAAmC;AAC/F,QAAM,wBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,EACF;AAEA,8DAA+B,mBAAmB,oDAAuB,6CAAiB;AAC1F,QAAM,EAAE,QAAQ,mBAAmB,YAAY,IAAI;AACnD,QAAM,EAAE,IAAI,YAAY,GAAG,YAAY,QAAI,wBAAK,gDAAuB,iBAAiB,GAAG,CAAC,QAAQ,QAAQ,MAAM,CAAC;AACnH,QAAM,EAAE,mBAAmB,gBAAgB,QAAI,yBAAW,4CAAkB;AAC5E,QAAM,UAAiB,qBAAO,IAAI;AAElC,QAAM,oBAAgB,sBAAQ,MAAM;AAClC,UAAM,KAAK,cAAc,uBAAmB,gBAAI;AAChD,sBAAkB,IAAI,GAAG;AACzB,WAAO;AAAA,EACT,GAAG,CAAC,mBAAmB,KAAK,UAAU,CAAC;AAEvC,QAAM,eAAW;AAAA,IACf,MAAO,oBAAoB,iBAAkB,CAAC,mBAAmB,cAAe,IAAI;AAAA,IACpF,CAAC,iBAAiB,aAAa,aAAa;AAAA,EAC9C;AAEA,QAAM,eAAW,sDAAuB,aAAa;AACrD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,eAAY;AAAA,MACZ,WAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ,sDAAC,qBAAkB,UAAU,KAAK,UAAoB;AAAA;AAAA,EACxD;AAEJ;AAEA,gBAAgB,YAAY;AAE5B,gBAAgB,cAAc;AAC9B,MAAM,gCAA4B,kCAAS,eAAe,EAAE,YAAY,cAAc;AACtF,0BAA0B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,6 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
8
12
|
var __copyProps = (to, from, except, desc) => {
|
|
9
13
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
14
|
for (let key of __getOwnPropNames(from))
|
|
@@ -24,9 +28,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
28
|
));
|
|
25
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
30
|
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
DSToolbarItemV2Schema: () => import_react_desc_prop_types.DSToolbarItemV2Schema,
|
|
33
|
+
DSToolbarV2Schema: () => import_react_desc_prop_types.DSToolbarV2Schema
|
|
34
|
+
});
|
|
27
35
|
module.exports = __toCommonJS(src_exports);
|
|
28
36
|
var React = __toESM(require("react"));
|
|
29
37
|
__reExport(src_exports, require("./DSToolbarV2.js"), module.exports);
|
|
30
38
|
__reExport(src_exports, require("./DSToolbarItemV2.js"), module.exports);
|
|
31
39
|
__reExport(src_exports, require("./DSToolbarSeparatorV2.js"), module.exports);
|
|
40
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
32
41
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './DSToolbarV2.js';\nexport * from './DSToolbarItemV2.js';\nexport * from './DSToolbarSeparatorV2.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from './DSToolbarV2.js';\nexport * from './DSToolbarItemV2.js';\nexport * from './DSToolbarSeparatorV2.js';\nexport type { DSToolbarT, DSToolbarItemT } from './react-desc-prop-types.js';\nexport { DSToolbarV2Schema, DSToolbarItemV2Schema } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,6BAAd;AACA,wBAAc,iCADd;AAEA,wBAAc,sCAFd;AAIA,mCAAyD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import {\n globalAttributesPropTypes,\n xstyledPropTypes,\n PropTypes,\n type GlobalAttributesT,\n type XstyledProps,\n type DSPropTypesSchema,\n} from '@elliemae/ds-props-helpers';\nimport { type WeakValidationMap } from 'react';\n\nexport declare namespace DSToolbarT {\n export interface DefaultProps {\n alignment: 'left' | 'right';\n withDepth: boolean;\n compact: boolean;\n }\n\n export interface OptionalProps {\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n children?: React.ReactNode;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n}\n\nexport declare namespace DSToolbarItemT {\n export type RenderHTMLElementT =\n | HTMLElement\n | HTMLButtonElement\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement\n | HTMLOptionElement\n | null;\n\n export
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import {\n globalAttributesPropTypes,\n xstyledPropTypes,\n PropTypes,\n type GlobalAttributesT,\n type XstyledProps,\n type DSPropTypesSchema,\n} from '@elliemae/ds-props-helpers';\nimport { type WeakValidationMap } from 'react';\n\nexport declare namespace DSToolbarT {\n export interface DefaultProps {\n alignment: 'left' | 'right';\n withDepth: boolean;\n compact: boolean;\n }\n\n export interface OptionalProps {\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n children?: React.ReactNode;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n}\n\nexport declare namespace DSToolbarItemT {\n type AnyRef<T> = React.MutableRefObject<T | null> | ((_ref: T | null) => void);\n\n export type RenderHTMLElementT =\n | HTMLElement\n | HTMLButtonElement\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement\n | HTMLOptionElement\n | null;\n\n export type RendererProps<T extends HTMLElement> = { innerRef: AnyRef<T>; tabIndex: 0 | -1 };\n\n export interface Props<T extends HTMLElement = HTMLElement | HTMLButtonElement> {\n render: React.ComponentType<RendererProps<T>>;\n isFirstItem?: boolean;\n }\n}\n\nexport const defaultItemProps: DSToolbarItemT.Props<HTMLElement> = {\n render: () => <></>,\n isFirstItem: false,\n};\n\nexport const defaultProps: DSToolbarT.DefaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\n\nexport const DSToolbarPropTypes: DSPropTypesSchema<DSToolbarT.Props> = {\n ...xstyledPropTypes,\n ...globalAttributesPropTypes,\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n\nexport const DSToolbarV2Schema = DSToolbarPropTypes as unknown as WeakValidationMap<DSToolbarT.Props>;\n\nexport const DSToolbarItemV2PropTypes = {\n ...xstyledPropTypes,\n ...globalAttributesPropTypes,\n render: PropTypes.func.isRequired.description('render function').defaultValue(() => {}),\n isFirstItem: PropTypes.bool\n .description(\n 'If true the item will have tab index 0 to be the first element focusable by keyboard on the page load',\n )\n .defaultValue(false),\n};\n\nexport const DSToolbarItemV2Schema = DSToolbarPropTypes as unknown as WeakValidationMap<DSToolbarItemT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuDP;AAvDhB,8BAOO;AA+CA,MAAM,mBAAsD;AAAA,EACjE,QAAQ,MAAM,2EAAE;AAAA,EAChB,aAAa;AACf;AAEO,MAAM,eAAwC;AAAA,EACnD,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AACX;AAEO,MAAM,qBAA0D;AAAA,EACrE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,WAAW,kCAAU,MAAM,CAAC,SAAS,MAAM,CAAC,EACzC,YAAY,4CAA4C,EACxD,aAAa,OAAO;AAAA,EACvB,WAAW,kCAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,IAAI;AAAA,EACvG,SAAS,kCAAU,KAAK,YAAY,qDAAqD,EAAE,aAAa,KAAK;AAAA,EAC7G,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE,YAAY,oCAAoC;AACpH;AAEO,MAAM,oBAAoB;AAE1B,MAAM,2BAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,QAAQ,kCAAU,KAAK,WAAW,YAAY,iBAAiB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACtF,aAAa,kCAAU,KACpB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,wBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,7 +15,10 @@ import { useToolbarItemHandlers } from "./useToolbarItemHandlers.js";
|
|
|
15
15
|
import { defaultItemProps, DSToolbarItemV2Schema } from "./react-desc-prop-types.js";
|
|
16
16
|
import { DSToolbarItemName } from "./DSToolbarDefinitions.js";
|
|
17
17
|
const DSToolbarItemV2 = (props) => {
|
|
18
|
-
const propsWithDefaults = useMemoMergePropsWithDefault(
|
|
18
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(
|
|
19
|
+
props,
|
|
20
|
+
defaultItemProps
|
|
21
|
+
);
|
|
19
22
|
useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarItemV2Schema, DSToolbarItemName);
|
|
20
23
|
const { render: ComponentRenderer, isFirstItem } = propsWithDefaults;
|
|
21
24
|
const { id: providedId, ...restGlobals } = omit(useGetGlobalAttributes(propsWithDefaults), ["rows", "cols", "wrap"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSToolbarItemV2.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { omit } from 'lodash';\nimport { DSToolbarV2Context } from './DSToolbarV2Context.js';\nimport { StyledToolbarItem } from './styled.js';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers.js';\nimport { defaultItemProps, DSToolbarItemV2Schema } from './react-desc-prop-types.js';\nimport type { DSToolbarItemT } from './react-desc-prop-types.js';\nimport { DSToolbarItemName } from './DSToolbarDefinitions.js';\nconst DSToolbarItemV2
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { omit } from 'lodash';\nimport { DSToolbarV2Context } from './DSToolbarV2Context.js';\nimport { StyledToolbarItem } from './styled.js';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers.js';\nimport { defaultItemProps, DSToolbarItemV2Schema } from './react-desc-prop-types.js';\nimport type { DSToolbarItemT } from './react-desc-prop-types.js';\nimport { DSToolbarItemName } from './DSToolbarDefinitions.js';\nconst DSToolbarItemV2 = <T extends HTMLElement = HTMLElement>(props: DSToolbarItemT.Props<T>) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSToolbarItemT.Props<T>>(\n props,\n defaultItemProps as unknown as DSToolbarItemT.Props<T>,\n );\n\n useValidateTypescriptPropTypes(propsWithDefaults, DSToolbarItemV2Schema, DSToolbarItemName);\n const { render: ComponentRenderer, isFirstItem } = propsWithDefaults;\n const { id: providedId, ...restGlobals } = omit(useGetGlobalAttributes(propsWithDefaults), ['rows', 'cols', 'wrap']);\n const { registerReference, dndDraggingItem } = useContext(DSToolbarV2Context);\n const ref: AnyRef<T> = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = providedId ?? `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref, providedId]);\n\n const tabIndex = useMemo(\n () => (dndDraggingItem === toolbarItemId || (!dndDraggingItem && isFirstItem) ? 0 : -1),\n [dndDraggingItem, isFirstItem, toolbarItemId],\n );\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n return (\n <StyledToolbarItem\n id={toolbarItemId}\n data-testid=\"ds-toolbar-item\"\n className=\"ds-toolbar-item\"\n {...handlers}\n {...restGlobals}\n >\n <ComponentRenderer innerRef={ref} tabIndex={tabIndex} />\n </StyledToolbarItem>\n );\n};\n\nDSToolbarItemV2.propTypes = DSToolbarItemV2Schema;\n\nDSToolbarItemV2.displayName = DSToolbarItemName;\nconst DSToolbarItemV2WithSchema = describe(DSToolbarItemV2).description('Toolbar Item');\nDSToolbarItemV2WithSchema.propTypes = DSToolbarItemV2Schema;\n\nexport { DSToolbarItemV2, DSToolbarItemV2WithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgDjB;AA/CN,SAAgB,YAAY,SAAS,cAAc;AACnD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW;AACpB,SAAS,YAAY;AACrB,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB,6BAA6B;AAExD,SAAS,yBAAyB;AAClC,MAAM,kBAAkB,CAAsC,UAAmC;AAC/F,QAAM,oBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,EACF;AAEA,iCAA+B,mBAAmB,uBAAuB,iBAAiB;AAC1F,QAAM,EAAE,QAAQ,mBAAmB,YAAY,IAAI;AACnD,QAAM,EAAE,IAAI,YAAY,GAAG,YAAY,IAAI,KAAK,uBAAuB,iBAAiB,GAAG,CAAC,QAAQ,QAAQ,MAAM,CAAC;AACnH,QAAM,EAAE,mBAAmB,gBAAgB,IAAI,WAAW,kBAAkB;AAC5E,QAAM,MAAiB,OAAO,IAAI;AAElC,QAAM,gBAAgB,QAAQ,MAAM;AAClC,UAAM,KAAK,cAAc,mBAAmB,IAAI;AAChD,sBAAkB,IAAI,GAAG;AACzB,WAAO;AAAA,EACT,GAAG,CAAC,mBAAmB,KAAK,UAAU,CAAC;AAEvC,QAAM,WAAW;AAAA,IACf,MAAO,oBAAoB,iBAAkB,CAAC,mBAAmB,cAAe,IAAI;AAAA,IACpF,CAAC,iBAAiB,aAAa,aAAa;AAAA,EAC9C;AAEA,QAAM,WAAW,uBAAuB,aAAa;AACrD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,eAAY;AAAA,MACZ,WAAU;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ,8BAAC,qBAAkB,UAAU,KAAK,UAAoB;AAAA;AAAA,EACxD;AAEJ;AAEA,gBAAgB,YAAY;AAE5B,gBAAgB,cAAc;AAC9B,MAAM,4BAA4B,SAAS,eAAe,EAAE,YAAY,cAAc;AACtF,0BAA0B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,4 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
export * from "./DSToolbarV2.js";
|
|
3
3
|
export * from "./DSToolbarItemV2.js";
|
|
4
4
|
export * from "./DSToolbarSeparatorV2.js";
|
|
5
|
+
import { DSToolbarV2Schema, DSToolbarItemV2Schema } from "./react-desc-prop-types.js";
|
|
6
|
+
export {
|
|
7
|
+
DSToolbarItemV2Schema,
|
|
8
|
+
DSToolbarV2Schema
|
|
9
|
+
};
|
|
5
10
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSToolbarV2.js';\nexport * from './DSToolbarItemV2.js';\nexport * from './DSToolbarSeparatorV2.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSToolbarV2.js';\nexport * from './DSToolbarItemV2.js';\nexport * from './DSToolbarSeparatorV2.js';\nexport type { DSToolbarT, DSToolbarItemT } from './react-desc-prop-types.js';\nexport { DSToolbarV2Schema, DSToolbarItemV2Schema } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;AAEd,SAAS,mBAAmB,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n globalAttributesPropTypes,\n xstyledPropTypes,\n PropTypes,\n type GlobalAttributesT,\n type XstyledProps,\n type DSPropTypesSchema,\n} from '@elliemae/ds-props-helpers';\nimport { type WeakValidationMap } from 'react';\n\nexport declare namespace DSToolbarT {\n export interface DefaultProps {\n alignment: 'left' | 'right';\n withDepth: boolean;\n compact: boolean;\n }\n\n export interface OptionalProps {\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n children?: React.ReactNode;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n}\n\nexport declare namespace DSToolbarItemT {\n export type RenderHTMLElementT =\n | HTMLElement\n | HTMLButtonElement\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement\n | HTMLOptionElement\n | null;\n\n export
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n globalAttributesPropTypes,\n xstyledPropTypes,\n PropTypes,\n type GlobalAttributesT,\n type XstyledProps,\n type DSPropTypesSchema,\n} from '@elliemae/ds-props-helpers';\nimport { type WeakValidationMap } from 'react';\n\nexport declare namespace DSToolbarT {\n export interface DefaultProps {\n alignment: 'left' | 'right';\n withDepth: boolean;\n compact: boolean;\n }\n\n export interface OptionalProps {\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n children?: React.ReactNode;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n}\n\nexport declare namespace DSToolbarItemT {\n type AnyRef<T> = React.MutableRefObject<T | null> | ((_ref: T | null) => void);\n\n export type RenderHTMLElementT =\n | HTMLElement\n | HTMLButtonElement\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement\n | HTMLOptionElement\n | null;\n\n export type RendererProps<T extends HTMLElement> = { innerRef: AnyRef<T>; tabIndex: 0 | -1 };\n\n export interface Props<T extends HTMLElement = HTMLElement | HTMLButtonElement> {\n render: React.ComponentType<RendererProps<T>>;\n isFirstItem?: boolean;\n }\n}\n\nexport const defaultItemProps: DSToolbarItemT.Props<HTMLElement> = {\n render: () => <></>,\n isFirstItem: false,\n};\n\nexport const defaultProps: DSToolbarT.DefaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\n\nexport const DSToolbarPropTypes: DSPropTypesSchema<DSToolbarT.Props> = {\n ...xstyledPropTypes,\n ...globalAttributesPropTypes,\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n\nexport const DSToolbarV2Schema = DSToolbarPropTypes as unknown as WeakValidationMap<DSToolbarT.Props>;\n\nexport const DSToolbarItemV2PropTypes = {\n ...xstyledPropTypes,\n ...globalAttributesPropTypes,\n render: PropTypes.func.isRequired.description('render function').defaultValue(() => {}),\n isFirstItem: PropTypes.bool\n .description(\n 'If true the item will have tab index 0 to be the first element focusable by keyboard on the page load',\n )\n .defaultValue(false),\n};\n\nexport const DSToolbarItemV2Schema = DSToolbarPropTypes as unknown as WeakValidationMap<DSToolbarItemT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuDP;AAvDhB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AA+CA,MAAM,mBAAsD;AAAA,EACjE,QAAQ,MAAM,gCAAE;AAAA,EAChB,aAAa;AACf;AAEO,MAAM,eAAwC;AAAA,EACnD,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AACX;AAEO,MAAM,qBAA0D;AAAA,EACrE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,WAAW,UAAU,MAAM,CAAC,SAAS,MAAM,CAAC,EACzC,YAAY,4CAA4C,EACxD,aAAa,OAAO;AAAA,EACvB,WAAW,UAAU,KAAK,YAAY,8CAA8C,EAAE,aAAa,IAAI;AAAA,EACvG,SAAS,UAAU,KAAK,YAAY,qDAAqD,EAAE,aAAa,KAAK;AAAA,EAC7G,UAAU,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE,YAAY,oCAAoC;AACpH;AAEO,MAAM,oBAAoB;AAE1B,MAAM,2BAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,QAAQ,UAAU,KAAK,WAAW,YAAY,iBAAiB,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACtF,aAAa,UAAU,KACpB;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AACvB;AAEO,MAAM,wBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DSToolbarItemT } from './react-desc-prop-types.js';
|
|
3
|
-
declare const DSToolbarItemV2:
|
|
4
|
-
|
|
3
|
+
declare const DSToolbarItemV2: {
|
|
4
|
+
<T extends HTMLElement = HTMLElement>(props: DSToolbarItemT.Props<T>): import("react/jsx-runtime.js").JSX.Element;
|
|
5
|
+
propTypes: React.WeakValidationMap<DSToolbarItemT.Props<HTMLElement | HTMLButtonElement>>;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
declare const DSToolbarItemV2WithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSToolbarItemT.Props<HTMLElement | HTMLButtonElement>>;
|
|
5
9
|
export { DSToolbarItemV2, DSToolbarItemV2WithSchema };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './DSToolbarV2.js';
|
|
2
2
|
export * from './DSToolbarItemV2.js';
|
|
3
3
|
export * from './DSToolbarSeparatorV2.js';
|
|
4
|
+
export type { DSToolbarT, DSToolbarItemT } from './react-desc-prop-types.js';
|
|
5
|
+
export { DSToolbarV2Schema, DSToolbarItemV2Schema } from './react-desc-prop-types.js';
|
|
@@ -16,16 +16,18 @@ export declare namespace DSToolbarT {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
export declare namespace DSToolbarItemT {
|
|
19
|
+
type AnyRef<T> = React.MutableRefObject<T | null> | ((_ref: T | null) => void);
|
|
19
20
|
type RenderHTMLElementT = HTMLElement | HTMLButtonElement | HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLOptionElement | null;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
type RendererProps<T extends HTMLElement> = {
|
|
22
|
+
innerRef: AnyRef<T>;
|
|
23
|
+
tabIndex: 0 | -1;
|
|
24
|
+
};
|
|
25
|
+
interface Props<T extends HTMLElement = HTMLElement | HTMLButtonElement> {
|
|
26
|
+
render: React.ComponentType<RendererProps<T>>;
|
|
25
27
|
isFirstItem?: boolean;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
|
-
export declare const defaultItemProps: DSToolbarItemT.Props
|
|
30
|
+
export declare const defaultItemProps: DSToolbarItemT.Props<HTMLElement>;
|
|
29
31
|
export declare const defaultProps: DSToolbarT.DefaultProps;
|
|
30
32
|
export declare const DSToolbarPropTypes: DSPropTypesSchema<DSToolbarT.Props>;
|
|
31
33
|
export declare const DSToolbarV2Schema: WeakValidationMap<DSToolbarT.Props>;
|
|
@@ -483,4 +485,4 @@ export declare const DSToolbarItemV2PropTypes: {
|
|
|
483
485
|
borderRadius: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
484
486
|
boxShadow: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
485
487
|
};
|
|
486
|
-
export declare const DSToolbarItemV2Schema: WeakValidationMap<DSToolbarItemT.Props
|
|
488
|
+
export declare const DSToolbarItemV2Schema: WeakValidationMap<DSToolbarItemT.Props<HTMLElement | HTMLButtonElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-toolbar-v2",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.29.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Toolbar V2",
|
|
6
6
|
"files": [
|
|
@@ -89,16 +89,16 @@
|
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"prop-types": "~15.8.1",
|
|
91
91
|
"uid": "2.0.1",
|
|
92
|
-
"@elliemae/ds-button": "3.
|
|
93
|
-
"@elliemae/ds-grid": "3.
|
|
94
|
-
"@elliemae/ds-
|
|
95
|
-
"@elliemae/ds-
|
|
96
|
-
"@elliemae/ds-system": "3.
|
|
92
|
+
"@elliemae/ds-button": "3.29.0-next.2",
|
|
93
|
+
"@elliemae/ds-grid": "3.29.0-next.2",
|
|
94
|
+
"@elliemae/ds-props-helpers": "3.29.0-next.2",
|
|
95
|
+
"@elliemae/ds-icons": "3.29.0-next.2",
|
|
96
|
+
"@elliemae/ds-system": "3.29.0-next.2"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
100
100
|
"styled-components": "~5.3.9",
|
|
101
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
101
|
+
"@elliemae/ds-monorepo-devops": "3.29.0-next.2"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"lodash": "^4.17.21",
|