@kopexa/chip 3.0.4 → 3.0.6
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/chunk-42TMQZWM.mjs +61 -0
- package/dist/chunk-YHRMEWSB.mjs +36 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +94 -2
- package/dist/index.mjs +9 -1
- package/dist/related-control-chip.d.mts +19 -0
- package/dist/related-control-chip.d.ts +19 -0
- package/dist/related-control-chip.js +85 -0
- package/dist/related-control-chip.mjs +7 -0
- package/dist/standard-chip.d.mts +13 -0
- package/dist/standard-chip.d.ts +13 -0
- package/dist/standard-chip.js +59 -0
- package/dist/standard-chip.mjs +7 -0
- package/package.json +7 -5
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/related-control-chip.tsx
|
|
4
|
+
import {
|
|
5
|
+
ChevronsLeftRightEllipsisIcon,
|
|
6
|
+
EqualsIcon,
|
|
7
|
+
IntersectIcon,
|
|
8
|
+
PartialIcon,
|
|
9
|
+
SubsetIcon,
|
|
10
|
+
SupersetIcon
|
|
11
|
+
} from "@kopexa/icons";
|
|
12
|
+
import {
|
|
13
|
+
relatedControlChip
|
|
14
|
+
} from "@kopexa/theme";
|
|
15
|
+
import { Tooltip } from "@kopexa/tooltip";
|
|
16
|
+
import * as Slot from "@radix-ui/react-slot";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var MappingIconMapper = {
|
|
19
|
+
EQUAL: /* @__PURE__ */ jsx(EqualsIcon, {}),
|
|
20
|
+
INTERSECT: /* @__PURE__ */ jsx(IntersectIcon, {}),
|
|
21
|
+
SUBSET: /* @__PURE__ */ jsx(SubsetIcon, {}),
|
|
22
|
+
PARTIAL: /* @__PURE__ */ jsx(PartialIcon, {}),
|
|
23
|
+
SUPERSET: /* @__PURE__ */ jsx(SupersetIcon, {})
|
|
24
|
+
};
|
|
25
|
+
var RelatedControlChip = ({
|
|
26
|
+
refCode,
|
|
27
|
+
mappingType,
|
|
28
|
+
relation,
|
|
29
|
+
asChild
|
|
30
|
+
}) => {
|
|
31
|
+
const tooltipDisabled = !relation && !mappingType;
|
|
32
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
33
|
+
const styles = relatedControlChip();
|
|
34
|
+
if (!tooltipDisabled) {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
Tooltip,
|
|
37
|
+
{
|
|
38
|
+
side: "top",
|
|
39
|
+
className: styles.tooltip(),
|
|
40
|
+
content: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: mappingType && /* @__PURE__ */ jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
41
|
+
/* @__PURE__ */ jsx(ChevronsLeftRightEllipsisIcon, { size: 12 }),
|
|
42
|
+
/* @__PURE__ */ jsx("span", { children: "Mapping type" }),
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: `ml-4 flex w-2.5 h-2.5 justify-center items-center ${mappingType === "SUPERSET" ? "h-5 w-5" : "h-2.5 w-2.5"}`,
|
|
47
|
+
children: MappingIconMapper[mappingType]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx("span", { className: "capitalize", children: mappingType.toLowerCase() })
|
|
51
|
+
] }) }),
|
|
52
|
+
children: /* @__PURE__ */ jsx(Comp, { className: styles.root(), children: refCode })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ jsx(Comp, { className: styles.root(), children: refCode });
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
RelatedControlChip
|
|
61
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/standard-chip.tsx
|
|
4
|
+
import { standardChip } from "@kopexa/theme";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var StandardChip = (props) => {
|
|
7
|
+
const {
|
|
8
|
+
className,
|
|
9
|
+
size,
|
|
10
|
+
radius,
|
|
11
|
+
color,
|
|
12
|
+
variant,
|
|
13
|
+
standard: standardProp,
|
|
14
|
+
...rest
|
|
15
|
+
} = props;
|
|
16
|
+
let standard = standardProp;
|
|
17
|
+
if (standardChip.variants.standard[standardProp]) {
|
|
18
|
+
standard = standardProp;
|
|
19
|
+
}
|
|
20
|
+
const styles = standardChip({
|
|
21
|
+
size,
|
|
22
|
+
radius,
|
|
23
|
+
color,
|
|
24
|
+
variant,
|
|
25
|
+
className,
|
|
26
|
+
standard
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.root(), ...rest, children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: styles.hexagon() }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: styles.content(), children: standard })
|
|
31
|
+
] });
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
StandardChip
|
|
36
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { Chip, ChipProps } from './chip.mjs';
|
|
2
|
+
export { RelatedControlChip, RelatedControlChipProps } from './related-control-chip.mjs';
|
|
3
|
+
export { StandardChip, StandardChipProps } from './standard-chip.mjs';
|
|
2
4
|
import 'react/jsx-runtime';
|
|
3
5
|
import '@kopexa/theme';
|
|
4
6
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { Chip, ChipProps } from './chip.js';
|
|
2
|
+
export { RelatedControlChip, RelatedControlChipProps } from './related-control-chip.js';
|
|
3
|
+
export { StandardChip, StandardChipProps } from './standard-chip.js';
|
|
2
4
|
import 'react/jsx-runtime';
|
|
3
5
|
import '@kopexa/theme';
|
|
4
6
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -16,12 +18,22 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
18
|
}
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
30
|
|
|
21
31
|
// src/index.ts
|
|
22
32
|
var index_exports = {};
|
|
23
33
|
__export(index_exports, {
|
|
24
|
-
Chip: () => Chip
|
|
34
|
+
Chip: () => Chip,
|
|
35
|
+
RelatedControlChip: () => RelatedControlChip,
|
|
36
|
+
StandardChip: () => StandardChip
|
|
25
37
|
});
|
|
26
38
|
module.exports = __toCommonJS(index_exports);
|
|
27
39
|
|
|
@@ -126,7 +138,87 @@ var Chip = (props) => {
|
|
|
126
138
|
}
|
|
127
139
|
);
|
|
128
140
|
};
|
|
141
|
+
|
|
142
|
+
// src/related-control-chip.tsx
|
|
143
|
+
var import_icons2 = require("@kopexa/icons");
|
|
144
|
+
var import_theme2 = require("@kopexa/theme");
|
|
145
|
+
var import_tooltip = require("@kopexa/tooltip");
|
|
146
|
+
var Slot = __toESM(require("@radix-ui/react-slot"));
|
|
147
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
148
|
+
var MappingIconMapper = {
|
|
149
|
+
EQUAL: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.EqualsIcon, {}),
|
|
150
|
+
INTERSECT: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.IntersectIcon, {}),
|
|
151
|
+
SUBSET: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.SubsetIcon, {}),
|
|
152
|
+
PARTIAL: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.PartialIcon, {}),
|
|
153
|
+
SUPERSET: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.SupersetIcon, {})
|
|
154
|
+
};
|
|
155
|
+
var RelatedControlChip = ({
|
|
156
|
+
refCode,
|
|
157
|
+
mappingType,
|
|
158
|
+
relation,
|
|
159
|
+
asChild
|
|
160
|
+
}) => {
|
|
161
|
+
const tooltipDisabled = !relation && !mappingType;
|
|
162
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
163
|
+
const styles = (0, import_theme2.relatedControlChip)();
|
|
164
|
+
if (!tooltipDisabled) {
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
166
|
+
import_tooltip.Tooltip,
|
|
167
|
+
{
|
|
168
|
+
side: "top",
|
|
169
|
+
className: styles.tooltip(),
|
|
170
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex flex-col gap-1", children: mappingType && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex gap-1 items-center", children: [
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons2.ChevronsLeftRightEllipsisIcon, { size: 12 }),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "Mapping type" }),
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: `ml-4 flex w-2.5 h-2.5 justify-center items-center ${mappingType === "SUPERSET" ? "h-5 w-5" : "h-2.5 w-2.5"}`,
|
|
177
|
+
children: MappingIconMapper[mappingType]
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "capitalize", children: mappingType.toLowerCase() })
|
|
181
|
+
] }) }),
|
|
182
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Comp, { className: styles.root(), children: refCode })
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Comp, { className: styles.root(), children: refCode });
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// src/standard-chip.tsx
|
|
190
|
+
var import_theme3 = require("@kopexa/theme");
|
|
191
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
192
|
+
var StandardChip = (props) => {
|
|
193
|
+
const {
|
|
194
|
+
className,
|
|
195
|
+
size,
|
|
196
|
+
radius,
|
|
197
|
+
color,
|
|
198
|
+
variant,
|
|
199
|
+
standard: standardProp,
|
|
200
|
+
...rest
|
|
201
|
+
} = props;
|
|
202
|
+
let standard = standardProp;
|
|
203
|
+
if (import_theme3.standardChip.variants.standard[standardProp]) {
|
|
204
|
+
standard = standardProp;
|
|
205
|
+
}
|
|
206
|
+
const styles = (0, import_theme3.standardChip)({
|
|
207
|
+
size,
|
|
208
|
+
radius,
|
|
209
|
+
color,
|
|
210
|
+
variant,
|
|
211
|
+
className,
|
|
212
|
+
standard
|
|
213
|
+
});
|
|
214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: styles.root(), ...rest, children: [
|
|
215
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: styles.hexagon() }),
|
|
216
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: styles.content(), children: standard })
|
|
217
|
+
] });
|
|
218
|
+
};
|
|
129
219
|
// Annotate the CommonJS export names for ESM import in node:
|
|
130
220
|
0 && (module.exports = {
|
|
131
|
-
Chip
|
|
221
|
+
Chip,
|
|
222
|
+
RelatedControlChip,
|
|
223
|
+
StandardChip
|
|
132
224
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { RelatedControlChipVariantsProps } from '@kopexa/theme';
|
|
3
|
+
|
|
4
|
+
type MappingType = "EQUAL" | "INTERSECT" | "PARTIAL" | "SUBSET" | "SUPERSET";
|
|
5
|
+
type RelatedControlChipProps = RelatedControlChipVariantsProps & {
|
|
6
|
+
refCode: string;
|
|
7
|
+
mappingType?: MappingType;
|
|
8
|
+
relation?: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Render the chip as a different component.
|
|
11
|
+
* @default false
|
|
12
|
+
* @example
|
|
13
|
+
* <RelatedControlChip asChild><Link to="/path">Link</Link></RelatedControlChip>
|
|
14
|
+
*/
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const RelatedControlChip: ({ refCode, mappingType, relation, asChild, }: RelatedControlChipProps) => react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { RelatedControlChip, type RelatedControlChipProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { RelatedControlChipVariantsProps } from '@kopexa/theme';
|
|
3
|
+
|
|
4
|
+
type MappingType = "EQUAL" | "INTERSECT" | "PARTIAL" | "SUBSET" | "SUPERSET";
|
|
5
|
+
type RelatedControlChipProps = RelatedControlChipVariantsProps & {
|
|
6
|
+
refCode: string;
|
|
7
|
+
mappingType?: MappingType;
|
|
8
|
+
relation?: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Render the chip as a different component.
|
|
11
|
+
* @default false
|
|
12
|
+
* @example
|
|
13
|
+
* <RelatedControlChip asChild><Link to="/path">Link</Link></RelatedControlChip>
|
|
14
|
+
*/
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const RelatedControlChip: ({ refCode, mappingType, relation, asChild, }: RelatedControlChipProps) => react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { RelatedControlChip, type RelatedControlChipProps };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/related-control-chip.tsx
|
|
32
|
+
var related_control_chip_exports = {};
|
|
33
|
+
__export(related_control_chip_exports, {
|
|
34
|
+
RelatedControlChip: () => RelatedControlChip
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(related_control_chip_exports);
|
|
37
|
+
var import_icons = require("@kopexa/icons");
|
|
38
|
+
var import_theme = require("@kopexa/theme");
|
|
39
|
+
var import_tooltip = require("@kopexa/tooltip");
|
|
40
|
+
var Slot = __toESM(require("@radix-ui/react-slot"));
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var MappingIconMapper = {
|
|
43
|
+
EQUAL: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EqualsIcon, {}),
|
|
44
|
+
INTERSECT: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.IntersectIcon, {}),
|
|
45
|
+
SUBSET: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SubsetIcon, {}),
|
|
46
|
+
PARTIAL: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.PartialIcon, {}),
|
|
47
|
+
SUPERSET: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SupersetIcon, {})
|
|
48
|
+
};
|
|
49
|
+
var RelatedControlChip = ({
|
|
50
|
+
refCode,
|
|
51
|
+
mappingType,
|
|
52
|
+
relation,
|
|
53
|
+
asChild
|
|
54
|
+
}) => {
|
|
55
|
+
const tooltipDisabled = !relation && !mappingType;
|
|
56
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
57
|
+
const styles = (0, import_theme.relatedControlChip)();
|
|
58
|
+
if (!tooltipDisabled) {
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_tooltip.Tooltip,
|
|
61
|
+
{
|
|
62
|
+
side: "top",
|
|
63
|
+
className: styles.tooltip(),
|
|
64
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-col gap-1", children: mappingType && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-1 items-center", children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ChevronsLeftRightEllipsisIcon, { size: 12 }),
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Mapping type" }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: `ml-4 flex w-2.5 h-2.5 justify-center items-center ${mappingType === "SUPERSET" ? "h-5 w-5" : "h-2.5 w-2.5"}`,
|
|
71
|
+
children: MappingIconMapper[mappingType]
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "capitalize", children: mappingType.toLowerCase() })
|
|
75
|
+
] }) }),
|
|
76
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { className: styles.root(), children: refCode })
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { className: styles.root(), children: refCode });
|
|
81
|
+
};
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
RelatedControlChip
|
|
85
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { StandardChipVariants } from '@kopexa/theme';
|
|
3
|
+
import { ChipProps } from './chip.mjs';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
type Omitted = "indicator" | "indicatorColor" | "startContent" | "endContent" | "standard";
|
|
7
|
+
type BaseProps = ChipProps & StandardChipVariants;
|
|
8
|
+
type StandardChipProps = Omit<BaseProps, Omitted> & {
|
|
9
|
+
standard: string;
|
|
10
|
+
};
|
|
11
|
+
declare const StandardChip: (props: StandardChipProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { StandardChip, type StandardChipProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { StandardChipVariants } from '@kopexa/theme';
|
|
3
|
+
import { ChipProps } from './chip.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
type Omitted = "indicator" | "indicatorColor" | "startContent" | "endContent" | "standard";
|
|
7
|
+
type BaseProps = ChipProps & StandardChipVariants;
|
|
8
|
+
type StandardChipProps = Omit<BaseProps, Omitted> & {
|
|
9
|
+
standard: string;
|
|
10
|
+
};
|
|
11
|
+
declare const StandardChip: (props: StandardChipProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { StandardChip, type StandardChipProps };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/standard-chip.tsx
|
|
22
|
+
var standard_chip_exports = {};
|
|
23
|
+
__export(standard_chip_exports, {
|
|
24
|
+
StandardChip: () => StandardChip
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(standard_chip_exports);
|
|
27
|
+
var import_theme = require("@kopexa/theme");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
var StandardChip = (props) => {
|
|
30
|
+
const {
|
|
31
|
+
className,
|
|
32
|
+
size,
|
|
33
|
+
radius,
|
|
34
|
+
color,
|
|
35
|
+
variant,
|
|
36
|
+
standard: standardProp,
|
|
37
|
+
...rest
|
|
38
|
+
} = props;
|
|
39
|
+
let standard = standardProp;
|
|
40
|
+
if (import_theme.standardChip.variants.standard[standardProp]) {
|
|
41
|
+
standard = standardProp;
|
|
42
|
+
}
|
|
43
|
+
const styles = (0, import_theme.standardChip)({
|
|
44
|
+
size,
|
|
45
|
+
radius,
|
|
46
|
+
color,
|
|
47
|
+
variant,
|
|
48
|
+
className,
|
|
49
|
+
standard
|
|
50
|
+
});
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.root(), ...rest, children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.hexagon() }),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.content(), children: standard })
|
|
54
|
+
] });
|
|
55
|
+
};
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
StandardChip
|
|
59
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/chip",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "A Chip is a small block of essential information that represent an input, attribute, or action.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chip"
|
|
@@ -28,12 +28,14 @@
|
|
|
28
28
|
"react": ">=19.0.0-rc.0",
|
|
29
29
|
"react-dom": ">=19.0.0-rc.0",
|
|
30
30
|
"motion": ">=12.23.6",
|
|
31
|
-
"@kopexa/theme": "1.7.
|
|
31
|
+
"@kopexa/theme": "1.7.5"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@kopexa/
|
|
36
|
-
"@kopexa/
|
|
34
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
35
|
+
"@kopexa/shared-utils": "1.1.6",
|
|
36
|
+
"@kopexa/react-utils": "2.0.7",
|
|
37
|
+
"@kopexa/icons": "10.0.6",
|
|
38
|
+
"@kopexa/tooltip": "6.0.5"
|
|
37
39
|
},
|
|
38
40
|
"clean-package": "../../../clean-package.config.json",
|
|
39
41
|
"module": "dist/index.mjs",
|