@digigov/react-experimental 2.0.0-a7ffb5dc → 2.0.0-aefd0709
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/FloatingButton/index.d.ts +1 -1
- package/FloatingButton/index.js +23 -23
- package/FloatingButton/index.js.map +7 -0
- package/Kitchensink/AllComponents/index.js +8 -0
- package/{FloatingButton/index.test → Kitchensink/AllComponents}/package.json +1 -1
- package/Kitchensink/AllComponents.d.ts +2 -0
- package/Kitchensink/AllComponents.js.map +7 -0
- package/Kitchensink/KitchensinkByCategory/index.js +44 -0
- package/Kitchensink/KitchensinkByCategory/package.json +6 -0
- package/Kitchensink/KitchensinkByCategory.d.ts +6 -0
- package/Kitchensink/KitchensinkByCategory.js.map +7 -0
- package/Kitchensink/KitchensinkByLetter/index.js +27 -0
- package/{OptionButtonSteps/index.test → Kitchensink/KitchensinkByLetter}/package.json +1 -1
- package/Kitchensink/KitchensinkByLetter.d.ts +6 -0
- package/Kitchensink/KitchensinkByLetter.js.map +7 -0
- package/Kitchensink/KitchensinkComponent/index.js +32 -0
- package/Kitchensink/KitchensinkComponent/package.json +6 -0
- package/Kitchensink/KitchensinkComponent.d.ts +10 -0
- package/Kitchensink/KitchensinkComponent.js.map +7 -0
- package/Kitchensink/KitchensinkDashboard/index.js +45 -0
- package/Kitchensink/KitchensinkDashboard/package.json +6 -0
- package/Kitchensink/KitchensinkDashboard.d.ts +5 -0
- package/Kitchensink/KitchensinkDashboard.js.map +7 -0
- package/Kitchensink/index.d.ts +5 -0
- package/Kitchensink/index.js +6 -0
- package/Kitchensink/index.js.map +7 -0
- package/{OptionButtonBase/index.test → Kitchensink}/package.json +1 -1
- package/OptionButtonBase/index.d.ts +5 -5
- package/OptionButtonBase/index.js +24 -23
- package/OptionButtonBase/index.js.map +7 -0
- package/OptionButtonSteps/index.d.ts +10 -10
- package/OptionButtonSteps/index.js +34 -29
- package/OptionButtonSteps/index.js.map +7 -0
- package/cjs/FloatingButton/index.js +55 -29
- package/cjs/FloatingButton/index.js.map +7 -0
- package/cjs/Kitchensink/AllComponents/index.js +41 -0
- package/cjs/Kitchensink/AllComponents.js.map +7 -0
- package/cjs/Kitchensink/KitchensinkByCategory/index.js +77 -0
- package/cjs/Kitchensink/KitchensinkByCategory.js.map +7 -0
- package/cjs/Kitchensink/KitchensinkByLetter/index.js +60 -0
- package/cjs/Kitchensink/KitchensinkByLetter.js.map +7 -0
- package/cjs/Kitchensink/KitchensinkComponent/index.js +62 -0
- package/cjs/Kitchensink/KitchensinkComponent.js.map +7 -0
- package/cjs/Kitchensink/KitchensinkDashboard/index.js +78 -0
- package/cjs/Kitchensink/KitchensinkDashboard.js.map +7 -0
- package/cjs/Kitchensink/index.js +30 -0
- package/cjs/Kitchensink/index.js.map +7 -0
- package/cjs/OptionButtonBase/index.js +56 -29
- package/cjs/OptionButtonBase/index.js.map +7 -0
- package/cjs/OptionButtonSteps/index.js +66 -35
- package/cjs/OptionButtonSteps/index.js.map +7 -0
- package/cjs/index.js +27 -37
- package/cjs/index.js.map +7 -0
- package/index.d.ts +1 -0
- package/index.js +6 -4
- package/index.js.map +7 -0
- package/package.json +7 -9
- package/src/FloatingButton/__snapshots__/index.test.tsx.snap +37 -0
- package/src/FloatingButton/index.test.tsx +11 -5
- package/src/FloatingButton/index.tsx +1 -1
- package/src/Kitchensink/AllComponents.tsx +6 -0
- package/src/Kitchensink/KitchensinkByCategory.tsx +54 -0
- package/src/Kitchensink/KitchensinkByLetter.tsx +35 -0
- package/src/Kitchensink/KitchensinkComponent.tsx +70 -0
- package/src/Kitchensink/KitchensinkDashboard.tsx +56 -0
- package/src/Kitchensink/index.ts +5 -0
- package/src/OptionButtonBase/__snapshots__/index.test.tsx.snap +37 -0
- package/src/OptionButtonBase/index.test.tsx +11 -5
- package/src/OptionButtonBase/index.tsx +8 -9
- package/src/OptionButtonSteps/__snapshots__/index.test.tsx.snap +84 -0
- package/src/OptionButtonSteps/index.test.tsx +21 -7
- package/src/OptionButtonSteps/index.tsx +10 -11
- package/src/index.ts +1 -0
- package/FloatingButton/index.test/index.js +0 -19
- package/OptionButtonBase/index.test/index.js +0 -19
- package/OptionButtonSteps/index.test/index.js +0 -32
- package/cjs/FloatingButton/index.test/index.js +0 -22
- package/cjs/OptionButtonBase/index.test/index.js +0 -22
- package/cjs/OptionButtonSteps/index.test/index.js +0 -35
|
@@ -1,31 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var OptionButtonBase_exports = {};
|
|
29
|
+
__export(OptionButtonBase_exports, {
|
|
30
|
+
OptionButtonBase: () => OptionButtonBase,
|
|
31
|
+
default: () => OptionButtonBase_default
|
|
6
32
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
as: "button",
|
|
27
|
-
ref: ref,
|
|
28
|
-
className: (0, _clsx["default"])(className, selected && 'ds-option-btn--selected', true && ['ds-btn', 'ds-option-btn'])
|
|
29
|
-
}, props), children);
|
|
33
|
+
module.exports = __toCommonJS(OptionButtonBase_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_clsx = __toESM(require("clsx"));
|
|
36
|
+
var import_Base = __toESM(require("@digigov/react-core/Base"));
|
|
37
|
+
const OptionButtonBase = import_react.default.forwardRef(function OptionButtonBase2({ selected = false, className, children, ...props }, ref) {
|
|
38
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
39
|
+
import_Base.default,
|
|
40
|
+
{
|
|
41
|
+
as: "button",
|
|
42
|
+
ref,
|
|
43
|
+
className: (0, import_clsx.default)(className, {
|
|
44
|
+
"ds-btn": true,
|
|
45
|
+
"ds-option-btn": true,
|
|
46
|
+
"ds-option-btn--selected": selected
|
|
47
|
+
}),
|
|
48
|
+
...props
|
|
49
|
+
},
|
|
50
|
+
children
|
|
51
|
+
);
|
|
30
52
|
});
|
|
31
|
-
var
|
|
53
|
+
var OptionButtonBase_default = OptionButtonBase;
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
OptionButtonBase
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/OptionButtonBase/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface OptionButtonBaseProps extends BaseProps<'button'> {\n /**\n * selected is optional.\n * Use selected prop to set selected styling.\n * @value true\n * @value false\n * @default false\n */\n selected?: boolean;\n}\n/**\n *\n * OptionButtonBases can be used to represent small blocks of information.\n * OptionButtonBase component must be inside OptionButtonBaseSection component.\n */\nexport const OptionButtonBase = React.forwardRef<\n HTMLButtonElement,\n OptionButtonBaseProps\n>(function OptionButtonBase(\n { selected = false, className, children, ...props },\n ref\n) {\n return (\n <Base\n as=\"button\"\n ref={ref}\n className={clsx(className, {\n 'ds-btn': true,\n 'ds-option-btn': true,\n 'ds-option-btn--selected': selected,\n })}\n {...props}\n >\n {children}\n </Base>\n );\n});\n\nexport default OptionButtonBase;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAiBzB,MAAM,mBAAmB,aAAAA,QAAM,WAGpC,SAASC,kBACT,EAAE,WAAW,OAAO,WAAW,UAAU,GAAG,MAAM,GAClD,KACA;AACA,SACE,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,2BAA2B;AAAA,MAC7B,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,2BAAQ;",
|
|
6
|
+
"names": ["React", "OptionButtonBase", "Base", "clsx"]
|
|
7
|
+
}
|
|
@@ -1,38 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var OptionButtonSteps_exports = {};
|
|
29
|
+
__export(OptionButtonSteps_exports, {
|
|
30
|
+
OptionButtonSteps: () => OptionButtonSteps,
|
|
31
|
+
default: () => OptionButtonSteps_default
|
|
6
32
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
* OptionButtonSteps can be used to represent small blocks of information.
|
|
17
|
-
* OptionButtonSteps component must be inside OptionButtonStepsSection component.
|
|
18
|
-
*/
|
|
19
|
-
var OptionButtonSteps = exports.OptionButtonSteps = /*#__PURE__*/_react["default"].forwardRef(function OptionButtonSteps(_ref, ref) {
|
|
20
|
-
var _ref$steps = _ref.steps,
|
|
21
|
-
steps = _ref$steps === void 0 ? 0 : _ref$steps,
|
|
22
|
-
_ref$activeStep = _ref.activeStep,
|
|
23
|
-
activeStep = _ref$activeStep === void 0 ? 0 : _ref$activeStep,
|
|
24
|
-
className = _ref.className,
|
|
25
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
26
|
-
var renderStep = function renderStep(step) {
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(_Base["default"], {
|
|
33
|
+
module.exports = __toCommonJS(OptionButtonSteps_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_clsx = __toESM(require("clsx"));
|
|
36
|
+
var import_Base = __toESM(require("@digigov/react-core/Base"));
|
|
37
|
+
const OptionButtonSteps = import_react.default.forwardRef(function OptionButtonSteps2({ steps = 0, activeStep = 0, className, ...props }, ref) {
|
|
38
|
+
const renderStep = (step) => /* @__PURE__ */ import_react.default.createElement(
|
|
39
|
+
import_Base.default,
|
|
40
|
+
{
|
|
28
41
|
as: "div",
|
|
29
|
-
className: (0,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
className: (0, import_clsx.default)(className, {
|
|
43
|
+
"ds-option-btn__step": true,
|
|
44
|
+
"ds-option-btn__step--active": activeStep >= step
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
import_Base.default,
|
|
50
|
+
{
|
|
51
|
+
as: "div",
|
|
52
|
+
ref,
|
|
53
|
+
className: (0, import_clsx.default)(className, {
|
|
54
|
+
"ds-option-btn__steps": true
|
|
55
|
+
}),
|
|
56
|
+
...props
|
|
57
|
+
},
|
|
58
|
+
steps >= 1 && renderStep(1),
|
|
59
|
+
steps >= 2 && renderStep(2),
|
|
60
|
+
steps >= 3 && renderStep(3),
|
|
61
|
+
steps >= 4 && renderStep(4)
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
var OptionButtonSteps_default = OptionButtonSteps;
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
OptionButtonSteps
|
|
37
68
|
});
|
|
38
|
-
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/OptionButtonSteps/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport clsx from 'clsx';\nimport Base, { BaseProps } from '@digigov/react-core/Base';\n\nexport interface OptionButtonStepsProps extends BaseProps<'div'> {\n /**\n * @value 0\n * @value 1\n * @value 2\n * @value 3\n * @value 4\n * @default 0\n */\n steps?: stepsProps;\n /**\n * @default 0\n */\n activeStep?: number;\n}\n\nexport type stepsProps = 0 | 1 | 2 | 3 | 4;\n/**\n *\n * OptionButtonSteps can be used to represent small blocks of information.\n * OptionButtonSteps component must be inside OptionButtonStepsSection component.\n */\nexport const OptionButtonSteps = React.forwardRef<\n HTMLDivElement,\n OptionButtonStepsProps\n>(function OptionButtonSteps(\n { steps = 0, activeStep = 0, className, ...props },\n ref\n) {\n const renderStep = (step: number) => (\n <Base\n as=\"div\"\n className={clsx(className, {\n 'ds-option-btn__step': true,\n 'ds-option-btn__step--active': activeStep >= step,\n })}\n ></Base>\n );\n\n return (\n <Base\n as=\"div\"\n ref={ref}\n className={clsx(className, {\n 'ds-option-btn__steps': true,\n })}\n {...props}\n >\n {steps >= 1 && renderStep(1)}\n {steps >= 2 && renderStep(2)}\n {steps >= 3 && renderStep(3)}\n {steps >= 4 && renderStep(4)}\n </Base>\n );\n});\n\nexport default OptionButtonSteps;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAAiB;AACjB,kBAAgC;AAwBzB,MAAM,oBAAoB,aAAAA,QAAM,WAGrC,SAASC,mBACT,EAAE,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,MAAM,GACjD,KACA;AACA,QAAM,aAAa,CAAC,SAClB,6BAAAD,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,uBAAuB;AAAA,QACvB,+BAA+B,cAAc;AAAA,MAC/C,CAAC;AAAA;AAAA,EACF;AAGH,SACE,6BAAAH,QAAA;AAAA,IAAC,YAAAE;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,eAAW,YAAAC,SAAK,WAAW;AAAA,QACzB,wBAAwB;AAAA,MAC1B,CAAC;AAAA,MACA,GAAG;AAAA;AAAA,IAEH,SAAS,KAAK,WAAW,CAAC;AAAA,IAC1B,SAAS,KAAK,WAAW,CAAC;AAAA,IAC1B,SAAS,KAAK,WAAW,CAAC;AAAA,IAC1B,SAAS,KAAK,WAAW,CAAC;AAAA,EAC7B;AAEJ,CAAC;AAED,IAAO,4BAAQ;",
|
|
6
|
+
"names": ["React", "OptionButtonSteps", "Base", "clsx"]
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var src_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(src_exports);
|
|
17
|
+
__reExport(src_exports, require("@digigov/react-experimental/FloatingButton"), module.exports);
|
|
18
|
+
__reExport(src_exports, require("@digigov/react-experimental/OptionButtonBase"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("@digigov/react-experimental/OptionButtonSteps"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("@digigov/react-experimental/Kitchensink"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("@digigov/react-experimental/FloatingButton"),
|
|
24
|
+
...require("@digigov/react-experimental/OptionButtonBase"),
|
|
25
|
+
...require("@digigov/react-experimental/OptionButtonSteps"),
|
|
26
|
+
...require("@digigov/react-experimental/Kitchensink")
|
|
5
27
|
});
|
|
6
|
-
|
|
7
|
-
Object.keys(_FloatingButton).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _FloatingButton[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _FloatingButton[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _OptionButtonBase = require("@digigov/react-experimental/OptionButtonBase");
|
|
18
|
-
Object.keys(_OptionButtonBase).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _OptionButtonBase[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _OptionButtonBase[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _OptionButtonSteps = require("@digigov/react-experimental/OptionButtonSteps");
|
|
29
|
-
Object.keys(_OptionButtonSteps).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _OptionButtonSteps[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _OptionButtonSteps[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from '@digigov/react-experimental/FloatingButton';\nexport * from '@digigov/react-experimental/OptionButtonBase';\nexport * from '@digigov/react-experimental/OptionButtonSteps';\nexport * from '@digigov/react-experimental/Kitchensink';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,uDAAd;AACA,wBAAc,yDADd;AAEA,wBAAc,0DAFd;AAGA,wBAAc,oDAHd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
/** @license Digigov v2.0.0-
|
|
1
|
+
/** @license Digigov v2.0.0-aefd0709
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the BSD-2-Clause license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
5
5
|
*/
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
6
|
+
export * from "@digigov/react-experimental/FloatingButton";
|
|
7
|
+
export * from "@digigov/react-experimental/OptionButtonBase";
|
|
8
|
+
export * from "@digigov/react-experimental/OptionButtonSteps";
|
|
9
|
+
export * from "@digigov/react-experimental/Kitchensink";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from '@digigov/react-experimental/FloatingButton';\nexport * from '@digigov/react-experimental/OptionButtonBase';\nexport * from '@digigov/react-experimental/OptionButtonSteps';\nexport * from '@digigov/react-experimental/Kitchensink';\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-experimental",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-aefd0709",
|
|
4
4
|
"description": "@digigov react experimental components",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
7
7
|
"main": "./cjs/index.js",
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@digigov/css": "2.0.0-
|
|
11
|
-
"@digigov/react-
|
|
12
|
-
"@digigov/
|
|
10
|
+
"@digigov/css": "2.0.0-aefd0709",
|
|
11
|
+
"@digigov/react-icons": "2.0.0-aefd0709",
|
|
12
|
+
"@digigov/ui": "2.0.0-aefd0709",
|
|
13
|
+
"@digigov/react-core": "2.0.0-aefd0709",
|
|
13
14
|
"clsx": "1.1.1",
|
|
14
|
-
"react": "
|
|
15
|
-
"react-dom": "
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"ts-morph": "18.0.0"
|
|
15
|
+
"react": ">=16.8.0 <19.0.0",
|
|
16
|
+
"react-dom": ">=16.8.0 <19.0.0"
|
|
19
17
|
},
|
|
20
18
|
"private": false,
|
|
21
19
|
"typings": "./index.d.ts"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`renders the FloatingButton with direction="left" 1`] = `
|
|
4
|
+
<body>
|
|
5
|
+
<div>
|
|
6
|
+
<button
|
|
7
|
+
class="ds-print-hidden ds-floating-btn ds-floating-btn--left ds-btn ds-btn-primary"
|
|
8
|
+
>
|
|
9
|
+
+
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
</body>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`renders the FloatingButton with direction="right" 1`] = `
|
|
16
|
+
<body>
|
|
17
|
+
<div>
|
|
18
|
+
<button
|
|
19
|
+
class="ds-print-hidden ds-floating-btn ds-floating-btn--right ds-btn ds-btn-primary"
|
|
20
|
+
>
|
|
21
|
+
+
|
|
22
|
+
</button>
|
|
23
|
+
</div>
|
|
24
|
+
</body>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`renders the FloatingButton with no props 1`] = `
|
|
28
|
+
<body>
|
|
29
|
+
<div>
|
|
30
|
+
<button
|
|
31
|
+
class="ds-print-hidden ds-floating-btn ds-floating-btn--right ds-btn ds-btn-primary"
|
|
32
|
+
>
|
|
33
|
+
+
|
|
34
|
+
</button>
|
|
35
|
+
</div>
|
|
36
|
+
</body>
|
|
37
|
+
`;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
3
|
|
|
4
4
|
import FloatingButton from '@digigov/react-experimental/FloatingButton';
|
|
5
5
|
|
|
6
6
|
it('renders the FloatingButton with no props', () => {
|
|
7
|
-
expect(
|
|
7
|
+
expect(
|
|
8
|
+
render(<FloatingButton>+</FloatingButton>).baseElement
|
|
9
|
+
).toMatchSnapshot();
|
|
8
10
|
});
|
|
9
11
|
it('renders the FloatingButton with direction="right"', () => {
|
|
10
|
-
expect(
|
|
12
|
+
expect(
|
|
13
|
+
render(<FloatingButton direction="right">+</FloatingButton>).baseElement
|
|
14
|
+
).toMatchSnapshot();
|
|
11
15
|
});
|
|
12
16
|
it('renders the FloatingButton with direction="left"', () => {
|
|
13
|
-
expect(
|
|
14
|
-
|
|
17
|
+
expect(
|
|
18
|
+
render(<FloatingButton direction="left">+</FloatingButton>).baseElement
|
|
19
|
+
).toMatchSnapshot();
|
|
20
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KitchenSinkCategory } from '@digigov/react-core/KitchenSinkCategory';
|
|
3
|
+
import { KitchenSinkHeading } from '@digigov/react-core/KitchenSinkHeading';
|
|
4
|
+
import { KitchensinkByLetter } from '@digigov/react-experimental/Kitchensink/KitchensinkByLetter';
|
|
5
|
+
|
|
6
|
+
export interface KitchensinkByCategoryInterface {
|
|
7
|
+
category: string;
|
|
8
|
+
stories: React.ReactElement[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const KitchensinkByCategory = ({
|
|
12
|
+
category,
|
|
13
|
+
stories,
|
|
14
|
+
}: KitchensinkByCategoryInterface) => {
|
|
15
|
+
const alphabeticalOrder = Object.keys(stories).reduce(
|
|
16
|
+
(abStories, componentStoriesKey) => {
|
|
17
|
+
const componentStories = stories[componentStoriesKey];
|
|
18
|
+
if (!componentStories.default.component) {
|
|
19
|
+
throw new Error(`no component was found in ${componentStoriesKey}`);
|
|
20
|
+
}
|
|
21
|
+
const name = componentStories.default.displayName;
|
|
22
|
+
console.log('componentStories', componentStories, 'stories', stories);
|
|
23
|
+
if (!name) {
|
|
24
|
+
throw new Error(`no name was found for ${componentStoriesKey}`);
|
|
25
|
+
}
|
|
26
|
+
const letter = name[0];
|
|
27
|
+
if (abStories[letter]) {
|
|
28
|
+
abStories[letter].push(componentStories);
|
|
29
|
+
} else {
|
|
30
|
+
abStories[letter] = [componentStories];
|
|
31
|
+
}
|
|
32
|
+
return abStories;
|
|
33
|
+
},
|
|
34
|
+
{}
|
|
35
|
+
);
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<KitchenSinkHeading>{category}</KitchenSinkHeading>
|
|
39
|
+
<KitchenSinkCategory>
|
|
40
|
+
{Object.keys(alphabeticalOrder)
|
|
41
|
+
.sort()
|
|
42
|
+
.map((letter, index) => {
|
|
43
|
+
return (
|
|
44
|
+
<KitchensinkByLetter
|
|
45
|
+
letter={letter}
|
|
46
|
+
stories={alphabeticalOrder[letter]}
|
|
47
|
+
key={index}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
})}
|
|
51
|
+
</KitchenSinkCategory>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Heading from '@digigov/react-core/Heading';
|
|
3
|
+
import { KitchenSinkLetterContent } from '@digigov/react-core/KitchenSinkLetterContent';
|
|
4
|
+
import { KitchensinkComponent } from '@digigov/react-experimental/Kitchensink/KitchensinkComponent';
|
|
5
|
+
|
|
6
|
+
export interface KitchensinkByLetterInterface {
|
|
7
|
+
letter: string;
|
|
8
|
+
stories: any;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const KitchensinkByLetter = ({
|
|
12
|
+
letter,
|
|
13
|
+
stories,
|
|
14
|
+
}: KitchensinkByLetterInterface) => {
|
|
15
|
+
return (
|
|
16
|
+
<div>
|
|
17
|
+
<Heading>{letter}</Heading>
|
|
18
|
+
<KitchenSinkLetterContent>
|
|
19
|
+
{stories.map((story, index) => {
|
|
20
|
+
return (
|
|
21
|
+
<KitchensinkComponent
|
|
22
|
+
tags={story.default.tags}
|
|
23
|
+
title={story.default.displayName}
|
|
24
|
+
description={story.default.description}
|
|
25
|
+
link={story.default.link}
|
|
26
|
+
width={story.default.defaultWidth}
|
|
27
|
+
stories={story}
|
|
28
|
+
key={index}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
})}
|
|
32
|
+
</KitchenSinkLetterContent>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KitchenSinkCard } from '@digigov/react-core/KitchenSinkCard';
|
|
3
|
+
import { KitchenSinkContent } from '@digigov/react-core/KitchenSinkContent';
|
|
4
|
+
import { KitchenSinkContentInfo } from '@digigov/react-core/KitchenSinkContentInfo';
|
|
5
|
+
import { KitchenSinkContentTags } from '@digigov/react-core/KitchenSinkContentTags';
|
|
6
|
+
import PhaseBanner, {
|
|
7
|
+
PhaseBannerTag,
|
|
8
|
+
PhaseBannerText,
|
|
9
|
+
} from '@digigov/ui/feedback/PhaseBanner';
|
|
10
|
+
import SectionBreak from '@digigov/ui/layouts/SectionBreak';
|
|
11
|
+
import Link from '@digigov/ui/navigation/Link';
|
|
12
|
+
import { Paragraph } from '@digigov/ui/typography';
|
|
13
|
+
import Heading from '@digigov/ui/typography/Heading';
|
|
14
|
+
|
|
15
|
+
export interface KitchensinkComponentInterface {
|
|
16
|
+
tags?: string[]; // ex. Experimental
|
|
17
|
+
title: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
link?: string;
|
|
20
|
+
stories: React.ReactElement[];
|
|
21
|
+
width?: 'md' | 'lg';
|
|
22
|
+
}
|
|
23
|
+
export const KitchensinkComponent = ({
|
|
24
|
+
tags = [],
|
|
25
|
+
title,
|
|
26
|
+
description,
|
|
27
|
+
link,
|
|
28
|
+
stories,
|
|
29
|
+
width = 'md',
|
|
30
|
+
}: KitchensinkComponentInterface) => {
|
|
31
|
+
return (
|
|
32
|
+
<KitchenSinkContent wide={width === 'lg'}>
|
|
33
|
+
<KitchenSinkContentInfo>
|
|
34
|
+
<KitchenSinkContentTags>
|
|
35
|
+
{tags &&
|
|
36
|
+
tags.map((tag, index) => {
|
|
37
|
+
return (
|
|
38
|
+
<PhaseBanner key={index}>
|
|
39
|
+
<PhaseBannerTag>{tag}</PhaseBannerTag>
|
|
40
|
+
<PhaseBannerText>
|
|
41
|
+
Αυτή είναι μία νέα υπηρεσία – τα{' '}
|
|
42
|
+
<Link href="#feedback">σχόλιά</Link> σας θα μας βοηθήσουν να
|
|
43
|
+
τη βελτιώσουμε.
|
|
44
|
+
</PhaseBannerText>
|
|
45
|
+
</PhaseBanner>
|
|
46
|
+
);
|
|
47
|
+
})}
|
|
48
|
+
</KitchenSinkContentTags>
|
|
49
|
+
<Heading size="lg">{title}</Heading>
|
|
50
|
+
<Paragraph>{description}</Paragraph>
|
|
51
|
+
{link && <Link href={link}>View on GOV.GR Design System</Link>}
|
|
52
|
+
<SectionBreak />
|
|
53
|
+
</KitchenSinkContentInfo>
|
|
54
|
+
{Object.keys(stories)
|
|
55
|
+
.filter((story) => story !== 'default')
|
|
56
|
+
.map((story, index) => {
|
|
57
|
+
const Component = stories[story];
|
|
58
|
+
return (
|
|
59
|
+
<div key={index}>
|
|
60
|
+
<SectionBreak />
|
|
61
|
+
<Heading size="sm">{story}</Heading>
|
|
62
|
+
<KitchenSinkCard>
|
|
63
|
+
<Component />
|
|
64
|
+
</KitchenSinkCard>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
})}
|
|
68
|
+
</KitchenSinkContent>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KitchenSinkAllComponents } from '@digigov/react-core/KitchenSinkAllComponents';
|
|
3
|
+
import Paragraph from '@digigov/react-core/Paragraph';
|
|
4
|
+
import { KitchensinkByCategory } from '@digigov/react-experimental/Kitchensink/KitchensinkByCategory';
|
|
5
|
+
|
|
6
|
+
export interface KitchenSinkDashboardInterface {
|
|
7
|
+
stories: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const KitchenSinkDashboard = ({
|
|
11
|
+
stories,
|
|
12
|
+
}: KitchenSinkDashboardInterface) => {
|
|
13
|
+
const categoryOrder = Object.keys(stories).reduce(
|
|
14
|
+
(catStories, componentStoriesKey) => {
|
|
15
|
+
const componentStories = stories[componentStoriesKey];
|
|
16
|
+
if (componentStories.default.ignore) {
|
|
17
|
+
return catStories;
|
|
18
|
+
}
|
|
19
|
+
if (!componentStories.default.component) {
|
|
20
|
+
throw new Error(`no component was found in ${componentStoriesKey}`);
|
|
21
|
+
}
|
|
22
|
+
const title = componentStories.default.title.split('/')[1];
|
|
23
|
+
if (!title) {
|
|
24
|
+
throw new Error(`no title was found for ${componentStoriesKey}`);
|
|
25
|
+
}
|
|
26
|
+
const category = title;
|
|
27
|
+
if (catStories[category]) {
|
|
28
|
+
catStories[category].push(componentStories);
|
|
29
|
+
} else {
|
|
30
|
+
catStories[category] = [componentStories];
|
|
31
|
+
}
|
|
32
|
+
return catStories;
|
|
33
|
+
},
|
|
34
|
+
{}
|
|
35
|
+
);
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<Paragraph fontSize={72} fontWeight="bold">
|
|
39
|
+
Components
|
|
40
|
+
</Paragraph>
|
|
41
|
+
<KitchenSinkAllComponents>
|
|
42
|
+
{Object.keys(categoryOrder)
|
|
43
|
+
.sort((a, b) => (a > b ? -1 : 1))
|
|
44
|
+
.map((category, index) => {
|
|
45
|
+
return (
|
|
46
|
+
<KitchensinkByCategory
|
|
47
|
+
category={category}
|
|
48
|
+
stories={categoryOrder[category]}
|
|
49
|
+
key={index}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
})}
|
|
53
|
+
</KitchenSinkAllComponents>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|