@elliemae/ds-chip 3.0.0-next.67

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 (41) hide show
  1. package/dist/cjs/DSChip.js +82 -0
  2. package/dist/cjs/DSChip.js.map +7 -0
  3. package/dist/cjs/config/useConfig.js +53 -0
  4. package/dist/cjs/config/useConfig.js.map +7 -0
  5. package/dist/cjs/constants.js +74 -0
  6. package/dist/cjs/constants.js.map +7 -0
  7. package/dist/cjs/exported_related/data-test-ids.js +32 -0
  8. package/dist/cjs/exported_related/data-test-ids.js.map +7 -0
  9. package/dist/cjs/exported_related/index.js +23 -0
  10. package/dist/cjs/exported_related/index.js.map +7 -0
  11. package/dist/cjs/exported_related/theming.js +34 -0
  12. package/dist/cjs/exported_related/theming.js.map +7 -0
  13. package/dist/cjs/index.js +24 -0
  14. package/dist/cjs/index.js.map +7 -0
  15. package/dist/cjs/react-desc-prop-types.js +59 -0
  16. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  17. package/dist/cjs/sharedTypes.js +20 -0
  18. package/dist/cjs/sharedTypes.js.map +7 -0
  19. package/dist/cjs/styles.js +175 -0
  20. package/dist/cjs/styles.js.map +7 -0
  21. package/dist/esm/DSChip.js +62 -0
  22. package/dist/esm/DSChip.js.map +7 -0
  23. package/dist/esm/config/useConfig.js +38 -0
  24. package/dist/esm/config/useConfig.js.map +7 -0
  25. package/dist/esm/constants.js +52 -0
  26. package/dist/esm/constants.js.map +7 -0
  27. package/dist/esm/exported_related/data-test-ids.js +10 -0
  28. package/dist/esm/exported_related/data-test-ids.js.map +7 -0
  29. package/dist/esm/exported_related/index.js +4 -0
  30. package/dist/esm/exported_related/index.js.map +7 -0
  31. package/dist/esm/exported_related/theming.js +12 -0
  32. package/dist/esm/exported_related/theming.js.map +7 -0
  33. package/dist/esm/index.js +5 -0
  34. package/dist/esm/index.js.map +7 -0
  35. package/dist/esm/react-desc-prop-types.js +50 -0
  36. package/dist/esm/react-desc-prop-types.js.map +7 -0
  37. package/dist/esm/sharedTypes.js +2 -0
  38. package/dist/esm/sharedTypes.js.map +7 -0
  39. package/dist/esm/styles.js +153 -0
  40. package/dist/esm/styles.js.map +7 -0
  41. package/package.json +91 -0
@@ -0,0 +1,153 @@
1
+ import * as React from "react";
2
+ import { styled, css } from "@elliemae/ds-system";
3
+ import { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from "./constants";
4
+ import { DSChipName, DSChipSlots } from "./exported_related";
5
+ const getChipSize = (shape) => shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes;
6
+ const styledChipSelectedCss = css`
7
+ & > div:first-child {
8
+ background-color: ${({ theme }) => theme.colors.brand[800]};
9
+ }
10
+ color: ${({ theme }) => theme.colors.brand[800]};
11
+ background-color: ${({ theme }) => theme.colors.brand[200]};
12
+
13
+ .ds-icon-svg {
14
+ fill: ${({ theme }) => theme.colors.brand[800]};
15
+ }
16
+
17
+ &:before {
18
+ border: 1px solid ${({ theme }) => theme.colors.brand[600]};
19
+ }
20
+
21
+ &:focus {
22
+ &:before {
23
+ border: 2px solid ${({ theme }) => theme.colors.brand[800]};
24
+ }
25
+ }
26
+ `;
27
+ const StyledChipLabel = styled("div", { name: DSChipName, slot: DSChipSlots.LABEL })`
28
+ font-size: ${({ theme }) => theme.fontSizes.label[200]};
29
+ font-weight: ${({ theme }) => theme.fontWeights.semibold};
30
+ word-wrap: break-word;
31
+ margin: 0 6px;
32
+ line-height: 1.45;
33
+ width: 100%;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ `;
38
+ const StyledChip = styled("button", { name: DSChipName, slot: DSChipSlots.BUTTON })`
39
+ position: relative;
40
+ display: flex;
41
+ flex-direction: column;
42
+ align-items: center;
43
+ justify-content: space-evenly;
44
+ border: none;
45
+ height: ${({ size, buttonShape }) => getChipSize(buttonShape)[size].height};
46
+ width: ${({ size, buttonShape }) => getChipSize(buttonShape)[size].width};
47
+ background-color: #fff;
48
+ color: ${({ theme }) => theme.colors.brand[600]};
49
+ border-radius: 4px;
50
+ cursor: pointer;
51
+ outline: none;
52
+
53
+ &:before {
54
+ content: '';
55
+ position: absolute;
56
+ top: 0;
57
+ left: 0;
58
+ width: 100%;
59
+ height: 100%;
60
+ border-radius: 4px;
61
+ border: 2px solid transparent;
62
+ }
63
+
64
+ & .ds-icon-root .ds-icon-svg {
65
+ fill: ${({ theme }) => theme.colors.brand[600]};
66
+ height: 24px;
67
+ width: 24px;
68
+ }
69
+
70
+ & .ds-icon-root {
71
+ height: 24px;
72
+ width: 24px;
73
+ }
74
+
75
+ &:hover {
76
+ & > div:first-child {
77
+ background-color: ${({ theme }) => theme.colors.brand[800]};
78
+ }
79
+ color: ${({ theme }) => theme.colors.brand[800]};
80
+ background-color: ${({ theme }) => theme.colors.brand[200]};
81
+ .ds-icon-svg {
82
+ fill: ${({ theme }) => theme.colors.brand[800]};
83
+ }
84
+ }
85
+
86
+ &:focus {
87
+ &:before {
88
+ border-color: ${({ theme }) => theme.colors.brand[800]};
89
+ }
90
+ }
91
+
92
+ &:disabled {
93
+ color: ${({ theme }) => theme.colors.neutral[500]};
94
+ cursor: not-allowed;
95
+
96
+ .ds-icon-svg {
97
+ fill: ${({ theme }) => theme.colors.neutral[500]};
98
+ }
99
+
100
+ &:focus,
101
+ &:hover {
102
+ & > div:first-child {
103
+ background-color: ${({ theme }) => theme.colors.neutral[200]};
104
+ }
105
+ background-color: #fff;
106
+ cursor: not-allowed;
107
+ &:before {
108
+ border-color: transparent;
109
+ }
110
+
111
+ ${StyledChipLabel} {
112
+ color: ${({ theme }) => theme.colors.neutral[500]};
113
+ }
114
+ }
115
+
116
+ &:hover .ds-icon-svg {
117
+ fill: ${({ theme }) => theme.colors.neutral[500]};
118
+ }
119
+ }
120
+
121
+ ${({ selected }) => !selected ? "" : styledChipSelectedCss}
122
+ `;
123
+ const disabledRoundShape = css`
124
+ background-color: ${({ theme }) => theme.colors.neutral[200]};
125
+
126
+ & .ds-icon-root .ds-icon-svg {
127
+ fill: ${({ theme }) => theme.colors.neutral[500]};
128
+ }
129
+ `;
130
+ const StyledRoundShape = styled("div", { name: DSChipName, slot: DSChipSlots.ROUND_SHAPE })`
131
+ background-color: ${({ theme }) => theme.colors.brand[600]};
132
+ width: ${({ size }) => size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall};
133
+ height: ${({ size }) => size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall};
134
+ border-radius: 50px;
135
+ display: flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ margin: 3px 0px;
139
+
140
+ & .ds-icon-root .ds-icon-svg {
141
+ fill: #fff;
142
+ height: 24px;
143
+ width: 24px;
144
+ }
145
+
146
+ ${({ disabled }) => disabled && disabledRoundShape}
147
+ `;
148
+ export {
149
+ StyledChip,
150
+ StyledChipLabel,
151
+ StyledRoundShape
152
+ };
153
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { styled, css } from '@elliemae/ds-system';\nimport { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from './constants';\nimport type { ChipShapesT, ChipSizesT } from './sharedTypes';\nimport { DSChipName, DSChipSlots } from './exported_related';\n\nexport interface StyledChipPropsT {\n size: ChipSizesT;\n buttonShape: ChipShapesT;\n}\n\nconst getChipSize = (shape: ChipShapesT) => (shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes);\n\nconst styledChipSelectedCss = css`\n & > div:first-child {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n\n .ds-icon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n\n &:before {\n border: 1px solid ${({ theme }) => theme.colors.brand[600]};\n }\n\n &:focus {\n &:before {\n border: 2px solid ${({ theme }) => theme.colors.brand[800]};\n }\n }\n`;\n\nexport const StyledChipLabel = styled('div', { name: DSChipName, slot: DSChipSlots.LABEL })`\n font-size: ${({ theme }) => theme.fontSizes.label[200]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n word-wrap: break-word;\n margin: 0 6px;\n line-height: 1.45;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const StyledChip = styled('button', { name: DSChipName, slot: DSChipSlots.BUTTON })<{\n selected: boolean | undefined;\n}>`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-evenly;\n border: none;\n height: ${({ size, buttonShape }) => getChipSize(buttonShape)[size].height};\n width: ${({ size, buttonShape }) => getChipSize(buttonShape)[size].width};\n background-color: #fff;\n color: ${({ theme }) => theme.colors.brand[600]};\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n }\n\n & .ds-icon-root .ds-icon-svg {\n fill: ${({ theme }) => theme.colors.brand[600]};\n height: 24px;\n width: 24px;\n }\n\n & .ds-icon-root {\n height: 24px;\n width: 24px;\n }\n\n &:hover {\n & > div:first-child {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n .ds-icon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:focus {\n &:before {\n border-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:disabled {\n color: ${({ theme }) => theme.colors.neutral[500]};\n cursor: not-allowed;\n\n .ds-icon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &:focus,\n &:hover {\n & > div:first-child {\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n }\n background-color: #fff;\n cursor: not-allowed;\n &:before {\n border-color: transparent;\n }\n\n ${StyledChipLabel} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n &:hover .ds-icon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n ${({ selected }) => (!selected ? '' : styledChipSelectedCss)}\n`;\n\nconst disabledRoundShape = css`\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n\n & .ds-icon-root .ds-icon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n`;\n\nexport const StyledRoundShape = styled('div', { name: DSChipName, slot: DSChipSlots.ROUND_SHAPE })`\n background-color: ${({ theme }) => theme.colors.brand[600]};\n width: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n height: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n border-radius: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 3px 0px;\n\n & .ds-icon-root .ds-icon-svg {\n fill: #fff;\n height: 24px;\n width: 24px;\n }\n\n ${({ disabled }) => disabled && disabledRoundShape}\n`;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AAEA;AAOA,MAAM,cAAc,CAAC,UAAwB,UAAU,YAAY,QAAQ,aAAa;AAExF,MAAM,wBAAwB;AAAA;AAAA,wBAEN,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA,WAE/C,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA,sBACvB,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,YAG5C,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA,wBAItB,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,0BAKhC,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAKrD,MAA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQxD;AAAA,iBACS,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,cAKvC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA,IAI9C,CAAC,EAAE,eAAgB,CAAC,WAAW,KAAK;AAAA;AAGxC,MAAM,qBAAqB;AAAA,sBACL,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,YAG9C,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAIzC,MAAM,mBAAmB,OAAO,OAAO,EAAE,MAAM,YAAY,MAAM,YAAY,YAAY,CAAC;AAAA,sBAC3E,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA,WAC7C,CAAC,EAAE,WAAY,SAAS,WAAW,IAAI,kBAAkB;AAAA,YACxD,CAAC,EAAE,WAAY,SAAS,WAAW,IAAI,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAajE,CAAC,EAAE,eAAe,YAAY;AAAA;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "@elliemae/ds-chip",
3
+ "version": "3.0.0-next.67",
4
+ "license": "MIT",
5
+ "description": "ICE MT - Dimsum - Chip",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "module": "./dist/esm/index.js",
10
+ "main": "./dist/cjs/index.js",
11
+ "types": "./dist/types/index.d.ts",
12
+ "sideEffects": [
13
+ "*.css",
14
+ "*.scss"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://git.elliemae.io/platform-ui/dimsum.git"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "import": "./dist/esm/index.js",
23
+ "require": "./dist/cjs/index.js"
24
+ },
25
+ "./useConfig": {
26
+ "import": "./dist/esm/useConfig.js",
27
+ "require": "./dist/cjs/useConfig.js"
28
+ },
29
+ "./types/AppPickerTypes": {
30
+ "import": "./dist/esm/types/AppPickerTypes.js",
31
+ "require": "./dist/cjs/types/AppPickerTypes.js"
32
+ },
33
+ "./styles": {
34
+ "import": "./dist/esm/styles.js",
35
+ "require": "./dist/cjs/styles.js"
36
+ },
37
+ "./constants": {
38
+ "import": "./dist/esm/constants.js",
39
+ "require": "./dist/cjs/constants.js"
40
+ },
41
+ "./DSChip": {
42
+ "import": "./dist/esm/DSChip.js",
43
+ "require": "./dist/cjs/DSChip.js"
44
+ },
45
+ "./react-desc-prop-types": {
46
+ "import": "./dist/esm/react-desc-prop-types.js",
47
+ "require": "./dist/cjs/react-desc-prop-types.js"
48
+ },
49
+ "./sharedTypes": {
50
+ "import": "./dist/esm/sharedTypes.js",
51
+ "require": "./dist/cjs/sharedTypes.js"
52
+ }
53
+ },
54
+ "engines": {
55
+ "pnpm": ">=6",
56
+ "node": ">=16"
57
+ },
58
+ "author": "ICE MT",
59
+ "jestSonar": {
60
+ "sonar56x": true,
61
+ "reportPath": "reports",
62
+ "reportFile": "tests.xml",
63
+ "indent": 4
64
+ },
65
+ "scripts": {
66
+ "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
67
+ "test": "node ../../scripts/testing/test.mjs",
68
+ "lint": "node ../../scripts/lint.mjs",
69
+ "dts": "node ../../scripts/dts.mjs",
70
+ "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
71
+ },
72
+ "dependencies": {
73
+ "@elliemae/ds-system": "3.0.0-next.54",
74
+ "@elliemae/ds-truncated-tooltip-text": "3.0.0-next.54",
75
+ "@elliemae/ds-utilities": "3.0.0-next.54"
76
+ },
77
+ "devDependencies": {
78
+ "@testing-library/jest-dom": "~5.16.2",
79
+ "@testing-library/react": "~12.1.2",
80
+ "styled-components": "~5.3.3"
81
+ },
82
+ "peerDependencies": {
83
+ "react": "^17.0.2",
84
+ "react-dom": "^17.0.2",
85
+ "styled-components": "^5.3.3"
86
+ },
87
+ "publishConfig": {
88
+ "access": "public",
89
+ "typeSafety": false
90
+ }
91
+ }