oolib 2.142.0 → 2.144.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ export namespace icons {
22
22
  export { CalendarBlank };
23
23
  export { Trash };
24
24
  export { DotsThreeVertical };
25
+ export { DotsThreeCircle };
25
26
  export { DotsThree };
26
27
  export { CaretUp };
27
28
  export { CaretDown };
@@ -200,6 +201,7 @@ import { ArrowLeft } from 'phosphor-react';
200
201
  import { CalendarBlank } from 'phosphor-react';
201
202
  import { Trash } from 'phosphor-react';
202
203
  import { DotsThreeVertical } from 'phosphor-react';
204
+ import { DotsThreeCircle } from 'phosphor-react';
203
205
  import { DotsThree } from 'phosphor-react';
204
206
  import { CaretUp } from 'phosphor-react';
205
207
  import { CaretDown } from 'phosphor-react';
@@ -27,6 +27,7 @@ exports.icons = {
27
27
  CalendarBlank: phosphor_react_1.CalendarBlank,
28
28
  Trash: phosphor_react_1.Trash,
29
29
  DotsThreeVertical: phosphor_react_1.DotsThreeVertical,
30
+ DotsThreeCircle: phosphor_react_1.DotsThreeCircle,
30
31
  DotsThree: phosphor_react_1.DotsThree,
31
32
  CaretUp: phosphor_react_1.CaretUp,
32
33
  CaretDown: phosphor_react_1.CaretDown,
@@ -0,0 +1,8 @@
1
+ declare namespace _default {
2
+ let title: string;
3
+ namespace args {
4
+ let invert: boolean;
5
+ }
6
+ }
7
+ export default _default;
8
+ export function Icons(args: any): import("react").JSX.Element;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Icons = void 0;
11
+ var styled_components_1 = __importDefault(require("styled-components"));
12
+ var icons_1 = require("../../../icons");
13
+ var themes_1 = require("../../../themes");
14
+ var Typo2_1 = require("../../../v2/components/Typo2");
15
+ var TextInputs_1 = require("../../../v2/components/TextInputs");
16
+ var react_1 = require("react");
17
+ exports.default = {
18
+ title: "Components/Icons",
19
+ args: {
20
+ invert: false,
21
+ },
22
+ };
23
+ var StyledWrapperIconsGrid = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n position: relative;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(", ", 1fr));\n grid-template-rows: auto;\n grid-row-gap: 2rem;\n grid-column-gap: 2rem;\n"], ["\n width: 100%;\n position: relative;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(", ", 1fr));\n grid-template-rows: auto;\n grid-row-gap: 2rem;\n grid-column-gap: 2rem;\n"])), function (_a) {
24
+ var minWidth = _a.minWidth;
25
+ return minWidth;
26
+ });
27
+ var weightOptions = ['thin', 'light', 'regular', 'bold', 'fill', 'duotone'];
28
+ var Icons = function (args) {
29
+ var _a = (0, react_1.useState)(""), searchIcon = _a[0], setSearchIcon = _a[1];
30
+ var _b = (0, react_1.useState)(null), selectedIcon = _b[0], setSelectedIcon = _b[1];
31
+ var _c = (0, react_1.useState)('regular'), selectedWeight = _c[0], setSelectedWeight = _c[1];
32
+ var iconArray = Object.entries(icons_1.icons).map(function (_a) {
33
+ var key = _a[0], value = _a[1];
34
+ return ({
35
+ key: key,
36
+ value: value
37
+ });
38
+ });
39
+ var filterIcons = function (value) {
40
+ setSearchIcon(value);
41
+ };
42
+ var filteredIcons = iconArray.filter(function (icon) {
43
+ return icon.key.toLowerCase().includes(searchIcon.toLowerCase());
44
+ });
45
+ var handleIconClick = function (key, iconComponent) {
46
+ setSelectedIcon(selectedIcon === key ? null : key);
47
+ setSelectedWeight('regular');
48
+ };
49
+ return (React.createElement(React.Fragment, null,
50
+ React.createElement(TextInputs_1.TextInput, { value: searchIcon, onChange: function (id, value) { return filterIcons(value); }, label: "Search Icon" }),
51
+ React.createElement(StyledWrapperIconsGrid, { minWidth: "10rem" }, filteredIcons.map(function (_a) {
52
+ var key = _a.key, Icon = _a.value;
53
+ return (React.createElement("div", { key: key },
54
+ React.createElement("div", { style: {
55
+ display: "flex",
56
+ flexDirection: 'column',
57
+ alignItems: "center",
58
+ padding: "1rem",
59
+ cursor: "pointer",
60
+ border: selectedIcon === key ? '2px solid blue' : 'none',
61
+ }, onClick: function () { return handleIconClick(key, Icon); } },
62
+ React.createElement(Icon, { size: 24, color: "red" }),
63
+ React.createElement(Typo2_1.UI_CAPTION, null, key)),
64
+ selectedIcon === key && (React.createElement("div", { style: {
65
+ marginTop: '1rem',
66
+ padding: '1rem',
67
+ border: '1px solid #ccc',
68
+ borderRadius: '4px',
69
+ backgroundColor: '#f9f9f9',
70
+ width: '100svw'
71
+ } },
72
+ React.createElement("h4", { style: { marginBottom: '0.5rem' } }, "Select Weight:"),
73
+ React.createElement("select", { value: selectedWeight, onChange: function (e) { return setSelectedWeight(e.target.value); }, style: {
74
+ width: '100%',
75
+ padding: '0.5rem',
76
+ marginBottom: '1rem'
77
+ } }, weightOptions.map(function (weight) { return (React.createElement("option", { key: weight, value: weight }, weight)); })),
78
+ React.createElement("div", { style: { display: 'flex', justifyContent: 'center' } },
79
+ React.createElement(Icon, { size: 32, weight: selectedWeight === 'regular' ? undefined : selectedWeight })),
80
+ React.createElement(Typo2_1.UI_CAPTION, { style: { textAlign: 'center', marginTop: '0.5rem' } }, "<".concat(key, " size={32} ").concat(selectedWeight !== 'regular' ? "weight=\"".concat(selectedWeight, "\"") : '', " />"))))));
81
+ }))));
82
+ };
83
+ exports.Icons = Icons;
84
+ var templateObject_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.142.0",
3
+ "version": "2.144.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",