@elliemae/ds-skeleton 3.29.0-next.0 → 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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useSkeleton.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { DSSkeletonName } from '../exported-related/index.js';\nimport type { DSSkeletonT } from '../react-desc-prop-types.js';\nimport { defaultProps, DSSkeletonPropTypes } from '../react-desc-prop-types.js';\n\nexport const useSkeleton = (props: DSSkeletonT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);\n useValidateTypescriptPropTypes(props, DSSkeletonPropTypes, DSSkeletonName);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return { propsWithDefault, globalAttributes, xstyledProps, withChildren: !!propsWithDefault.children };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAKO;AACP,8BAA+B;AAE/B,mCAAkD;AAE3C,MAAM,cAAc,CAAC,UAA6B;AACvD,QAAM,uBAAmB,sDAA6B,OAAO,yCAAY;AACzE,8DAA+B,OAAO,kDAAqB,sCAAc;AAEzE,QAAM,uBAAmB,gDAAuB,gBAAgB;AAChE,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,SAAO,EAAE,kBAAkB,kBAAkB,cAAc,cAAc,CAAC,CAAC,iBAAiB,SAAS;AACvG;",
4
+ "sourcesContent": ["import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { DSSkeletonName } from '../exported-related/index.js';\nimport type { DSSkeletonT } from '../react-desc-prop-types.js';\nimport { defaultProps, DSSkeletonPropTypes } from '../react-desc-prop-types.js';\n\nexport const useSkeleton = (props: DSSkeletonT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSSkeletonT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(props, DSSkeletonPropTypes, DSSkeletonName);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return { propsWithDefault, globalAttributes, xstyledProps, withChildren: !!propsWithDefault.children };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAKO;AACP,8BAA+B;AAE/B,mCAAkD;AAE3C,MAAM,cAAc,CAAC,UAA6B;AACvD,QAAM,uBAAmB,sDAAwD,OAAO,yCAAY;AACpG,8DAA+B,OAAO,kDAAqB,sCAAc;AAEzE,QAAM,uBAAmB,gDAAuB,gBAAgB;AAChE,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,SAAO,EAAE,kBAAkB,kBAAkB,cAAc,cAAc,CAAC,CAAC,iBAAiB,SAAS;AACvG;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './DSSkeleton.js';\nexport * from './exported-related/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,4BAAd;AACA,wBAAc,wCADd;",
4
+ "sourcesContent": ["import type {} from '@xstyled/system';\nexport * from './DSSkeleton.js';\nexport * from './exported-related/index.js';\nexport type { DSSkeletonT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADCvB,wBAAc,4BADd;AAEA,wBAAc,wCAFd;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSkeletonT {\n interface IProps {\n variant?: 'circular' | 'rectangular' | 'text';\n }\n\n export interface Props extends IProps, Omit<GlobalAttributesT<HTMLSpanElement>, keyof IProps>, XstyledProps {}\n}\n\nexport const defaultProps: DSSkeletonT.Props = {\n variant: 'text',\n};\n\nexport const DSSkeletonPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n variant: PropTypes.oneOf(['circular', 'rectangular', 'text'])\n .description('Variant for the skeleton')\n .defaultValue('text'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AAUhE,MAAM,eAAkC;AAAA,EAC7C,SAAS;AACX;AAEO,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,kCAAU,MAAM,CAAC,YAAY,eAAe,MAAM,CAAC,EACzD,YAAY,0BAA0B,EACtC,aAAa,MAAM;AACxB;",
4
+ "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSkeletonT {\n interface DefaultProps {\n variant: 'circular' | 'rectangular' | 'text';\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n Omit<GlobalAttributesT<HTMLSpanElement>, keyof DefaultProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n Omit<GlobalAttributesT<HTMLSpanElement>, keyof DefaultProps>,\n XstyledProps {}\n}\n\nexport const defaultProps: DSSkeletonT.Props = {\n variant: 'text',\n};\n\nexport const DSSkeletonPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n variant: PropTypes.oneOf(['circular', 'rectangular', 'text'])\n .description('Variant for the skeleton')\n .defaultValue('text'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,8BAAuE;AAkBhE,MAAM,eAAkC;AAAA,EAC7C,SAAS;AACX;AAEO,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,kCAAU,MAAM,CAAC,YAAY,eAAe,MAAM,CAAC,EACzD,YAAY,0BAA0B,EACtC,aAAa,MAAM;AACxB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/styled/components.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSSkeletonName, DSSkeletonSlots } from '../exported-related/index.js';\nimport { pulseKeyframe } from './animation.js';\nimport { circularVariantCss, textVariantCss, withChildrenCss } from './variants.js';\n\ninterface StyledSkeletonProps {\n variant: 'circular' | 'rectangular' | 'text';\n withChildren: boolean;\n}\n\nexport const StyledSkeleton = styled('div', {\n name: DSSkeletonName,\n slot: DSSkeletonSlots.ROOT,\n})<StyledSkeletonProps>`\n display: block;\n height: 20px;\n background-color: ${th.color('neutral-400')}2f;\n ${(props) => {\n if (props.variant === 'circular') return circularVariantCss;\n if (props.variant === 'text') return textVariantCss;\n }}\n ${(props) => (props.withChildren ? withChildrenCss : '')}\n \n animation: ${pulseKeyframe} 1.5s ease-in-out 0.5s infinite;\n ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA+C;AAC/C,8BAAgD;AAChD,uBAA8B;AAC9B,sBAAoE;AAO7D,MAAM,qBAAiB,yBAAO,OAAO;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM,wCAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,sBAGqB,oBAAG,MAAM,aAAa;AAAA,IACxC,CAAC,UAAU;AACX,MAAI,MAAM,YAAY;AAAY,WAAO;AACzC,MAAI,MAAM,YAAY;AAAQ,WAAO;AACvC;AAAA,IACE,CAAC,UAAW,MAAM,eAAe,kCAAkB;AAAA;AAAA,eAExC;AAAA,IACX;AAAA;",
4
+ "sourcesContent": ["import { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSSkeletonName, DSSkeletonSlots } from '../exported-related/index.js';\nimport { pulseKeyframe } from './animation.js';\nimport { circularVariantCss, textVariantCss, withChildrenCss } from './variants.js';\n\ninterface StyledSkeletonProps {\n variant: 'circular' | 'rectangular' | 'text';\n withChildren: boolean;\n w?: unknown;\n h?: unknown;\n}\n\nexport const StyledSkeleton = styled('div', {\n name: DSSkeletonName,\n slot: DSSkeletonSlots.ROOT,\n})<StyledSkeletonProps>`\n display: block;\n height: 20px;\n background-color: ${th.color('neutral-400')}2f;\n ${(props) => {\n if (props.variant === 'circular') return circularVariantCss;\n if (props.variant === 'text') return textVariantCss;\n }}\n ${(props) => (props.withChildren ? withChildrenCss : '')}\n \n animation: ${pulseKeyframe} 1.5s ease-in-out 0.5s infinite;\n ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA+C;AAC/C,8BAAgD;AAChD,uBAA8B;AAC9B,sBAAoE;AAS7D,MAAM,qBAAiB,yBAAO,OAAO;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM,wCAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,sBAGqB,oBAAG,MAAM,aAAa;AAAA,IACxC,CAAC,UAAU;AACX,MAAI,MAAM,YAAY;AAAY,WAAO;AACzC,MAAI,MAAM,YAAY;AAAQ,WAAO;AACvC;AAAA,IACE,CAAC,UAAW,MAAM,eAAe,kCAAkB;AAAA;AAAA,eAExC;AAAA,IACX;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/styled/variants.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { css } from '@elliemae/ds-system';\n\nexport const textVariantCss = css`\n margin-top: 0;\n margin-bottom: 0;\n height: auto;\n transform-origin: 0 55%;\n transform: scale(1, 0.6);\n border-radius: 4px/4%;\n &:empty:before {\n content: '\\\\00a0';\n }\n`;\n\nexport const circularVariantCss = css`\n border-radius: 50%;\n`;\n\nexport const withChildrenCss = css<{ w: unknown; h: unknown }>`\n & > * {\n visibility: hidden;\n }\n\n ${({ w }) => (!w ? 'width: fit-content;' : '')}\n ${({ h }) => (!h ? 'height: auto;' : '')}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import { css } from '@elliemae/ds-system';\n\nexport const textVariantCss = css`\n margin-top: 0;\n margin-bottom: 0;\n height: auto;\n transform-origin: 0 55%;\n transform: scale(1, 0.6);\n border-radius: 4px/4%;\n &:empty:before {\n content: '\\\\00a0';\n }\n`;\n\nexport const circularVariantCss = css`\n border-radius: 50%;\n`;\n\nexport const withChildrenCss = css<{ w?: unknown; h?: unknown }>`\n & > * {\n visibility: hidden;\n }\n\n ${({ w }) => (!w ? 'width: fit-content;' : '')}\n ${({ h }) => (!h ? 'height: auto;' : '')}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoB;AAEb,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYvB,MAAM,qBAAqB;AAAA;AAAA;AAI3B,MAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,IAK3B,CAAC,EAAE,EAAE,MAAO,CAAC,IAAI,wBAAwB;AAAA,IACzC,CAAC,EAAE,EAAE,MAAO,CAAC,IAAI,kBAAkB;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var React = __toESM(require("react"));
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import__ = require("../index.js");
27
+ const testPartialDefaults = {};
28
+ const testProps = {
29
+ ...testPartialDefaults
30
+ };
31
+ const testPropsAsSyntax = {
32
+ ...testPartialDefaults
33
+ };
34
+ const testCompleteDefaults = {
35
+ variant: "rectangular"
36
+ };
37
+ const testInternalProps = {
38
+ ...testCompleteDefaults
39
+ };
40
+ const testInternalPropsAsSyntax = {
41
+ ...testCompleteDefaults
42
+ };
43
+ const testExplicitDefinition = {
44
+ variant: "circular"
45
+ };
46
+ const testInferedTypeCompatibility = {
47
+ variant: "text"
48
+ };
49
+ const testDefinitionAsConst = {
50
+ variant: "text"
51
+ };
52
+ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSkeleton, { ...testExplicitDefinition }),
54
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSkeleton, { ...testInferedTypeCompatibility }),
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSkeleton, { ...testDefinitionAsConst }),
56
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSSkeleton, { variant: "text" })
57
+ ] });
58
+ //# sourceMappingURL=typescript-skeleton-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-skeleton-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSSkeleton } from '../index.js';\nimport type { DSSkeletonT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSSkeletonT.Props;\ntype ComponentPropsInternals = DSSkeletonT.InternalProps;\ntype ComponentPropsDefaultProps = DSSkeletonT.DefaultProps;\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\n\nconst testProps: ComponentPropsForApp = {\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n variant: 'rectangular',\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n variant: 'circular',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n variant: 'text',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n variant: 'text',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSSkeleton {...testExplicitDefinition} />\n <DSSkeleton {...testInferedTypeCompatibility} />\n <DSSkeleton {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSSkeleton variant=\"text\" />\n </>\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACiDrB;AAhDF,eAA2B;AAU3B,MAAM,sBAA2D,CAAC;AAElE,MAAM,YAAkC;AAAA,EACtC,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,SAAS;AACX;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,SAAS;AACX;AAGA,MAAM,+BAA+B;AAAA,EACnC,SAAS;AACX;AAEA,MAAM,wBAAwB;AAAA,EAC5B,SAAS;AACX;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,uBAAY,GAAG,wBAAwB;AAAA,EACxC,4CAAC,uBAAY,GAAG,8BAA8B;AAAA,EAC9C,4CAAC,uBAAY,GAAG,uBAAuB;AAAA,EAEvC,4CAAC,uBAAW,SAAQ,QAAO;AAAA,GAC7B;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useSkeleton.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { DSSkeletonName } from '../exported-related/index.js';\nimport type { DSSkeletonT } from '../react-desc-prop-types.js';\nimport { defaultProps, DSSkeletonPropTypes } from '../react-desc-prop-types.js';\n\nexport const useSkeleton = (props: DSSkeletonT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);\n useValidateTypescriptPropTypes(props, DSSkeletonPropTypes, DSSkeletonName);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return { propsWithDefault, globalAttributes, xstyledProps, withChildren: !!propsWithDefault.children };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAE/B,SAAS,cAAc,2BAA2B;AAE3C,MAAM,cAAc,CAAC,UAA6B;AACvD,QAAM,mBAAmB,6BAA6B,OAAO,YAAY;AACzE,iCAA+B,OAAO,qBAAqB,cAAc;AAEzE,QAAM,mBAAmB,uBAAuB,gBAAgB;AAChE,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAO,EAAE,kBAAkB,kBAAkB,cAAc,cAAc,CAAC,CAAC,iBAAiB,SAAS;AACvG;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useValidateTypescriptPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { DSSkeletonName } from '../exported-related/index.js';\nimport type { DSSkeletonT } from '../react-desc-prop-types.js';\nimport { defaultProps, DSSkeletonPropTypes } from '../react-desc-prop-types.js';\n\nexport const useSkeleton = (props: DSSkeletonT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSSkeletonT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(props, DSSkeletonPropTypes, DSSkeletonName);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return { propsWithDefault, globalAttributes, xstyledProps, withChildren: !!propsWithDefault.children };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAE/B,SAAS,cAAc,2BAA2B;AAE3C,MAAM,cAAc,CAAC,UAA6B;AACvD,QAAM,mBAAmB,6BAAwD,OAAO,YAAY;AACpG,iCAA+B,OAAO,qBAAqB,cAAc;AAEzE,QAAM,mBAAmB,uBAAuB,gBAAgB;AAChE,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAO,EAAE,kBAAkB,kBAAkB,cAAc,cAAc,CAAC,CAAC,iBAAiB,SAAS;AACvG;",
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/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSSkeleton.js';\nexport * from './exported-related/index.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@xstyled/system';\nexport * from './DSSkeleton.js';\nexport * from './exported-related/index.js';\nexport type { DSSkeletonT } from './react-desc-prop-types.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,cAAc;AACd,cAAc;",
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.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSkeletonT {\n interface IProps {\n variant?: 'circular' | 'rectangular' | 'text';\n }\n\n export interface Props extends IProps, Omit<GlobalAttributesT<HTMLSpanElement>, keyof IProps>, XstyledProps {}\n}\n\nexport const defaultProps: DSSkeletonT.Props = {\n variant: 'text',\n};\n\nexport const DSSkeletonPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n variant: PropTypes.oneOf(['circular', 'rectangular', 'text'])\n .description('Variant for the skeleton')\n .defaultValue('text'),\n} as WeakValidationMap<unknown>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAUhE,MAAM,eAAkC;AAAA,EAC7C,SAAS;AACX;AAEO,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,UAAU,MAAM,CAAC,YAAY,eAAe,MAAM,CAAC,EACzD,YAAY,0BAA0B,EACtC,aAAa,MAAM;AACxB;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSSkeletonT {\n interface DefaultProps {\n variant: 'circular' | 'rectangular' | 'text';\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n Omit<GlobalAttributesT<HTMLSpanElement>, keyof DefaultProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n Omit<GlobalAttributesT<HTMLSpanElement>, keyof DefaultProps>,\n XstyledProps {}\n}\n\nexport const defaultProps: DSSkeletonT.Props = {\n variant: 'text',\n};\n\nexport const DSSkeletonPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n variant: PropTypes.oneOf(['circular', 'rectangular', 'text'])\n .description('Variant for the skeleton')\n .defaultValue('text'),\n} as WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,WAAW,2BAA2B,wBAAwB;AAkBhE,MAAM,eAAkC;AAAA,EAC7C,SAAS;AACX;AAEO,MAAM,sBAAsB;AAAA,EACjC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,UAAU,MAAM,CAAC,YAAY,eAAe,MAAM,CAAC,EACzD,YAAY,0BAA0B,EACtC,aAAa,MAAM;AACxB;",
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/styled/components.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSSkeletonName, DSSkeletonSlots } from '../exported-related/index.js';\nimport { pulseKeyframe } from './animation.js';\nimport { circularVariantCss, textVariantCss, withChildrenCss } from './variants.js';\n\ninterface StyledSkeletonProps {\n variant: 'circular' | 'rectangular' | 'text';\n withChildren: boolean;\n}\n\nexport const StyledSkeleton = styled('div', {\n name: DSSkeletonName,\n slot: DSSkeletonSlots.ROOT,\n})<StyledSkeletonProps>`\n display: block;\n height: 20px;\n background-color: ${th.color('neutral-400')}2f;\n ${(props) => {\n if (props.variant === 'circular') return circularVariantCss;\n if (props.variant === 'text') return textVariantCss;\n }}\n ${(props) => (props.withChildren ? withChildrenCss : '')}\n \n animation: ${pulseKeyframe} 1.5s ease-in-out 0.5s infinite;\n ${xStyledCommonProps}\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,IAAI,0BAA0B;AAC/C,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB,gBAAgB,uBAAuB;AAO7D,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,sBAGqB,GAAG,MAAM,aAAa;AAAA,IACxC,CAAC,UAAU;AACX,MAAI,MAAM,YAAY;AAAY,WAAO;AACzC,MAAI,MAAM,YAAY;AAAQ,WAAO;AACvC;AAAA,IACE,CAAC,UAAW,MAAM,eAAe,kBAAkB;AAAA;AAAA,eAExC;AAAA,IACX;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, th, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSSkeletonName, DSSkeletonSlots } from '../exported-related/index.js';\nimport { pulseKeyframe } from './animation.js';\nimport { circularVariantCss, textVariantCss, withChildrenCss } from './variants.js';\n\ninterface StyledSkeletonProps {\n variant: 'circular' | 'rectangular' | 'text';\n withChildren: boolean;\n w?: unknown;\n h?: unknown;\n}\n\nexport const StyledSkeleton = styled('div', {\n name: DSSkeletonName,\n slot: DSSkeletonSlots.ROOT,\n})<StyledSkeletonProps>`\n display: block;\n height: 20px;\n background-color: ${th.color('neutral-400')}2f;\n ${(props) => {\n if (props.variant === 'circular') return circularVariantCss;\n if (props.variant === 'text') return textVariantCss;\n }}\n ${(props) => (props.withChildren ? withChildrenCss : '')}\n \n animation: ${pulseKeyframe} 1.5s ease-in-out 0.5s infinite;\n ${xStyledCommonProps}\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,IAAI,0BAA0B;AAC/C,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB,gBAAgB,uBAAuB;AAS7D,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM,gBAAgB;AACxB,CAAC;AAAA;AAAA;AAAA,sBAGqB,GAAG,MAAM,aAAa;AAAA,IACxC,CAAC,UAAU;AACX,MAAI,MAAM,YAAY;AAAY,WAAO;AACzC,MAAI,MAAM,YAAY;AAAQ,WAAO;AACvC;AAAA,IACE,CAAC,UAAW,MAAM,eAAe,kBAAkB;AAAA;AAAA,eAExC;AAAA,IACX;AAAA;",
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/styled/variants.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { css } from '@elliemae/ds-system';\n\nexport const textVariantCss = css`\n margin-top: 0;\n margin-bottom: 0;\n height: auto;\n transform-origin: 0 55%;\n transform: scale(1, 0.6);\n border-radius: 4px/4%;\n &:empty:before {\n content: '\\\\00a0';\n }\n`;\n\nexport const circularVariantCss = css`\n border-radius: 50%;\n`;\n\nexport const withChildrenCss = css<{ w: unknown; h: unknown }>`\n & > * {\n visibility: hidden;\n }\n\n ${({ w }) => (!w ? 'width: fit-content;' : '')}\n ${({ h }) => (!h ? 'height: auto;' : '')}\n`;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { css } from '@elliemae/ds-system';\n\nexport const textVariantCss = css`\n margin-top: 0;\n margin-bottom: 0;\n height: auto;\n transform-origin: 0 55%;\n transform: scale(1, 0.6);\n border-radius: 4px/4%;\n &:empty:before {\n content: '\\\\00a0';\n }\n`;\n\nexport const circularVariantCss = css`\n border-radius: 50%;\n`;\n\nexport const withChildrenCss = css<{ w?: unknown; h?: unknown }>`\n & > * {\n visibility: hidden;\n }\n\n ${({ w }) => (!w ? 'width: fit-content;' : '')}\n ${({ h }) => (!h ? 'height: auto;' : '')}\n`;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW;AAEb,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYvB,MAAM,qBAAqB;AAAA;AAAA;AAI3B,MAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,IAK3B,CAAC,EAAE,EAAE,MAAO,CAAC,IAAI,wBAAwB;AAAA,IACzC,CAAC,EAAE,EAAE,MAAO,CAAC,IAAI,kBAAkB;AAAA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { DSSkeleton } from "../index.js";
4
+ const testPartialDefaults = {};
5
+ const testProps = {
6
+ ...testPartialDefaults
7
+ };
8
+ const testPropsAsSyntax = {
9
+ ...testPartialDefaults
10
+ };
11
+ const testCompleteDefaults = {
12
+ variant: "rectangular"
13
+ };
14
+ const testInternalProps = {
15
+ ...testCompleteDefaults
16
+ };
17
+ const testInternalPropsAsSyntax = {
18
+ ...testCompleteDefaults
19
+ };
20
+ const testExplicitDefinition = {
21
+ variant: "circular"
22
+ };
23
+ const testInferedTypeCompatibility = {
24
+ variant: "text"
25
+ };
26
+ const testDefinitionAsConst = {
27
+ variant: "text"
28
+ };
29
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
30
+ /* @__PURE__ */ jsx(DSSkeleton, { ...testExplicitDefinition }),
31
+ /* @__PURE__ */ jsx(DSSkeleton, { ...testInferedTypeCompatibility }),
32
+ /* @__PURE__ */ jsx(DSSkeleton, { ...testDefinitionAsConst }),
33
+ /* @__PURE__ */ jsx(DSSkeleton, { variant: "text" })
34
+ ] });
35
+ //# sourceMappingURL=typescript-skeleton-valid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-skeleton-valid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSSkeleton } from '../index.js';\nimport type { DSSkeletonT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSSkeletonT.Props;\ntype ComponentPropsInternals = DSSkeletonT.InternalProps;\ntype ComponentPropsDefaultProps = DSSkeletonT.DefaultProps;\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\n\nconst testProps: ComponentPropsForApp = {\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n variant: 'rectangular',\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n variant: 'circular',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n variant: 'text',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n variant: 'text',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSSkeleton {...testExplicitDefinition} />\n <DSSkeleton {...testInferedTypeCompatibility} />\n <DSSkeleton {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSSkeleton variant=\"text\" />\n </>\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiDrB,mBAEE,KAFF;AAhDF,SAAS,kBAAkB;AAU3B,MAAM,sBAA2D,CAAC;AAElE,MAAM,YAAkC;AAAA,EACtC,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,SAAS;AACX;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,SAAS;AACX;AAGA,MAAM,+BAA+B;AAAA,EACnC,SAAS;AACX;AAEA,MAAM,wBAAwB;AAAA,EAC5B,SAAS;AACX;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,cAAY,GAAG,wBAAwB;AAAA,EACxC,oBAAC,cAAY,GAAG,8BAA8B;AAAA,EAC9C,oBAAC,cAAY,GAAG,uBAAuB;AAAA,EAEvC,oBAAC,cAAW,SAAQ,QAAO;AAAA,GAC7B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ import type { DSSkeletonT } from '../react-desc-prop-types.js';
2
+ export declare const useSkeleton: (props: DSSkeletonT.Props) => {
3
+ propsWithDefault: DSSkeletonT.InternalProps;
4
+ globalAttributes: import("@elliemae/ds-props-helpers").GlobalAttributesT<Element>;
5
+ xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
6
+ withChildren: boolean;
7
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './DSSkeleton.js';
2
2
  export * from './exported-related/index.js';
3
+ export type { DSSkeletonT } from './react-desc-prop-types.js';
@@ -1,10 +1,12 @@
1
1
  import type { WeakValidationMap } from 'react';
2
2
  import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
3
3
  export declare namespace DSSkeletonT {
4
- interface IProps {
5
- variant?: 'circular' | 'rectangular' | 'text';
4
+ interface DefaultProps {
5
+ variant: 'circular' | 'rectangular' | 'text';
6
6
  }
7
- interface Props extends IProps, Omit<GlobalAttributesT<HTMLSpanElement>, keyof IProps>, XstyledProps {
7
+ interface Props extends Partial<DefaultProps>, Omit<GlobalAttributesT<HTMLSpanElement>, keyof DefaultProps>, XstyledProps {
8
+ }
9
+ interface InternalProps extends DefaultProps, Omit<GlobalAttributesT<HTMLSpanElement>, keyof DefaultProps>, XstyledProps {
8
10
  }
9
11
  }
10
12
  export declare const defaultProps: DSSkeletonT.Props;
@@ -1,6 +1,8 @@
1
1
  interface StyledSkeletonProps {
2
2
  variant: 'circular' | 'rectangular' | 'text';
3
3
  withChildren: boolean;
4
+ w?: unknown;
5
+ h?: unknown;
4
6
  }
5
7
  export declare const StyledSkeleton: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, StyledSkeletonProps & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
6
8
  export {};
@@ -0,0 +1,6 @@
1
+ export declare const textVariantCss: import("styled-components").FlattenSimpleInterpolation;
2
+ export declare const circularVariantCss: import("styled-components").FlattenSimpleInterpolation;
3
+ export declare const withChildrenCss: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
4
+ w?: unknown;
5
+ h?: unknown;
6
+ }, import("@xstyled/system").Theme>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-skeleton",
3
- "version": "3.29.0-next.0",
3
+ "version": "3.29.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Skeleton UI",
6
6
  "files": [
@@ -35,14 +35,14 @@
35
35
  "indent": 4
36
36
  },
37
37
  "dependencies": {
38
- "@elliemae/ds-props-helpers": "3.29.0-next.0",
39
- "@elliemae/ds-utilities": "3.29.0-next.0",
40
- "@elliemae/ds-system": "3.29.0-next.0"
38
+ "@elliemae/ds-props-helpers": "3.29.0-next.2",
39
+ "@elliemae/ds-utilities": "3.29.0-next.2",
40
+ "@elliemae/ds-system": "3.29.0-next.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@elliemae/pui-cli": "~9.0.0-next.31",
44
44
  "styled-components": "~5.3.9",
45
- "@elliemae/ds-monorepo-devops": "3.29.0-next.0"
45
+ "@elliemae/ds-monorepo-devops": "3.29.0-next.2"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": "^17.0.2",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public",
54
- "typeSafety": false
54
+ "typeSafety": true
55
55
  },
56
56
  "scripts": {
57
57
  "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",