@pismo/marola 1.0.0-beta.24 → 1.0.0-beta.27

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.
@@ -2,8 +2,12 @@ import { VariantType } from '../Typography/Typography.tsx';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  type OptionsProps = {
5
+ /** Text variant */
5
6
  variant?: VariantType;
7
+ /** Text color */
6
8
  color?: string;
9
+ /** Text weight */
10
+ bold?: boolean;
7
11
  };
8
12
  export interface TextDisplayProps {
9
13
  /** TextDisplay label */
@@ -12,8 +16,8 @@ export interface TextDisplayProps {
12
16
  value: React.ReactNode;
13
17
  /** Renders skeleton when true */
14
18
  isLoading?: boolean;
15
- /** Sets the testId prefix for label, value and skeletons */
16
- testId?: string;
19
+ /** Sets the data-testid prefix for label, value and skeletons */
20
+ 'data-testid'?: string;
17
21
  /** Sets the label options */
18
22
  labelOptions?: OptionsProps;
19
23
  /** Sets the value options */
@@ -21,5 +25,5 @@ export interface TextDisplayProps {
21
25
  /** Sets the label and value onto the same line */
22
26
  inline?: boolean;
23
27
  }
24
- export declare const TextDisplay: ({ label, value, isLoading, testId, labelOptions, valueOptions, inline, }: TextDisplayProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const TextDisplay: ({ label, value, isLoading, "data-testid": dataTestId, labelOptions, valueOptions, inline, }: TextDisplayProps) => import("react/jsx-runtime").JSX.Element;
25
29
  export {};
@@ -1,45 +1,45 @@
1
1
  import '../../assets/TextDisplay.css';
2
- import { jsxs as x, jsx as o } from "react/jsx-runtime";
3
- import { c as _ } from "../../clsx-DB4S2d7J.js";
4
- import { Skeleton as d } from "../Skeleton/Skeleton.js";
5
- import { Typography as m } from "../Typography/Typography.js";
6
- const f = "_container_ia8vu_1", n = {
7
- container: f,
2
+ import { jsxs as f, jsx as d } from "react/jsx-runtime";
3
+ import { c as $ } from "../../clsx-DB4S2d7J.js";
4
+ import { Skeleton as m } from "../Skeleton/Skeleton.js";
5
+ import { Typography as y } from "../Typography/Typography.js";
6
+ const g = "_container_ia8vu_1", e = {
7
+ container: g,
8
8
  "container--inline": "_container--inline_ia8vu_5"
9
- }, T = ({
10
- label: i,
11
- value: y,
12
- isLoading: e = !1,
13
- testId: c = "TextDisplay",
9
+ }, i = ({
10
+ label: h,
11
+ value: x,
12
+ isLoading: o = !1,
13
+ "data-testid": t = "TextDisplay",
14
14
  labelOptions: r,
15
- valueOptions: a,
16
- inline: t
15
+ valueOptions: c,
16
+ inline: a
17
17
  }) => {
18
- const h = r != null && r.color || t ? "var(--black-100)" : "var(--gray-90)";
19
- return /* @__PURE__ */ x(
18
+ const _ = (r == null ? void 0 : r.color) || (a ? "var(--black-100)" : "var(--gray-90)");
19
+ return /* @__PURE__ */ f(
20
20
  "div",
21
21
  {
22
- className: _([n.container, { [n["container--inline"]]: t }]),
23
- "data-testid": `${c}-container`,
22
+ className: $([e.container, { [e["container--inline"]]: a }]),
23
+ "data-testid": `${t}-container`,
24
24
  children: [
25
- /* @__PURE__ */ o(
26
- m,
25
+ /* @__PURE__ */ d(
26
+ y,
27
27
  {
28
- color: h,
28
+ color: _,
29
29
  variant: (r == null ? void 0 : r.variant) || "base",
30
- "data-testid": `${c}-label`,
31
- bold: t,
32
- children: e ? /* @__PURE__ */ o(d, { style: { width: 70, marginBottom: 2 }, "data-testid": `${c}-skeletonLabel` }) : i
30
+ "data-testid": `${t}-label`,
31
+ bold: (r == null ? void 0 : r.bold) ?? a,
32
+ children: o ? /* @__PURE__ */ d(m, { style: { width: 70, marginBottom: 2 }, "data-testid": `${t}-skeletonLabel` }) : h
33
33
  }
34
34
  ),
35
- /* @__PURE__ */ o(
36
- m,
35
+ /* @__PURE__ */ d(
36
+ y,
37
37
  {
38
- bold: !t,
39
- color: (a == null ? void 0 : a.color) || "var(--gray-90)",
40
- variant: a != null && a.variant || t ? "base" : "base-lg",
41
- "data-testid": `${c}-value`,
42
- children: e ? /* @__PURE__ */ o(d, { style: { width: 100 }, "data-testid": `${c}-skeletonValue` }) : y || "-"
38
+ bold: (c == null ? void 0 : c.bold) ?? !a,
39
+ color: (c == null ? void 0 : c.color) || "var(--gray-90)",
40
+ variant: (c == null ? void 0 : c.variant) || (a ? "base" : "base-lg"),
41
+ "data-testid": `${t}-value`,
42
+ children: o ? /* @__PURE__ */ d(m, { style: { width: 100 }, "data-testid": `${t}-skeletonValue` }) : x || "-"
43
43
  }
44
44
  )
45
45
  ]
@@ -47,5 +47,5 @@ const f = "_container_ia8vu_1", n = {
47
47
  );
48
48
  };
49
49
  export {
50
- T as TextDisplay
50
+ i as TextDisplay
51
51
  };
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ label, value, isLoading, testId, labelOptions, valueOptions, inline, }: import('./TextDisplay').TextDisplayProps) => import("react/jsx-runtime").JSX.Element;
5
+ component: ({ label, value, isLoading, "data-testid": dataTestId, labelOptions, valueOptions, inline, }: import('./TextDisplay').TextDisplayProps) => import("react/jsx-runtime").JSX.Element;
6
6
  tags: string[];
7
7
  };
8
8
  export default meta;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pismo/marola",
3
3
  "description": "CDX tribe component library",
4
- "version": "1.0.0-beta.24",
4
+ "version": "1.0.0-beta.27",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1,63 +0,0 @@
1
- import './assets/SelectButton.css';
2
- import { jsxs as l, jsx as _ } from "react/jsx-runtime";
3
- import * as o from "react";
4
- import { forwardRef as y } from "react";
5
- import { c as u } from "./clsx-DB4S2d7J.js";
6
- import { Typography as p } from "./components/Typography/Typography.js";
7
- const b = "_select__listbox__option__text_1d5mc_65", m = "_select__wrapper_1d5mc_78", g = "_select__label_1d5mc_78", x = "_select_1d5mc_65", w = "_select__popup_1d5mc_87", C = "_select__listbox_1d5mc_65", f = "_select__listbox__option_1d5mc_65", v = "_select__listbox__option__icon_1d5mc_108", L = "_select__list__option__icon_1d5mc_129", e = {
8
- "u-typography-h1": "_u-typography-h1_1d5mc_1",
9
- "u-typography-h2": "_u-typography-h2_1d5mc_8",
10
- "u-typography-h3": "_u-typography-h3_1d5mc_15",
11
- "u-typography-h4": "_u-typography-h4_1d5mc_22",
12
- "u-typography-h5": "_u-typography-h5_1d5mc_29",
13
- "u-typography-h6": "_u-typography-h6_1d5mc_36",
14
- "u-typography-base": "_u-typography-base_1d5mc_43",
15
- "u-typography-base--xxl": "_u-typography-base--xxl_1d5mc_49",
16
- "u-typography-base--xl": "_u-typography-base--xl_1d5mc_53",
17
- "u-typography-base--lg": "_u-typography-base--lg_1d5mc_57",
18
- "u-typography-base--sm": "_u-typography-base--sm_1d5mc_61",
19
- "u-typography-base--bold": "_u-typography-base--bold_1d5mc_65",
20
- select__listbox__option__text: b,
21
- "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1d5mc_68",
22
- "u-typography-base--underlined": "_u-typography-base--underlined_1d5mc_71",
23
- "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1d5mc_74",
24
- select__wrapper: m,
25
- select__label: g,
26
- select: x,
27
- select__popup: w,
28
- select__listbox: C,
29
- select__listbox__option: f,
30
- select__listbox__option__icon: v,
31
- "select__listbox__option--disabled": "_select__listbox__option--disabled_1d5mc_112",
32
- "select__listbox__option--selected": "_select__listbox__option--selected_1d5mc_121",
33
- select__list__option__icon: L,
34
- "select-button": "_select-button_1d5mc_134",
35
- "base-Select-popup": "_base-Select-popup_1d5mc_152",
36
- "select-button__text": "_select-button__text_1d5mc_155",
37
- "select-button__icon": "_select-button__icon_1d5mc_164",
38
- "select-button--active": "_select-button--active_1d5mc_170"
39
- }, S = (t) => /* @__PURE__ */ o.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ o.createElement("path", { d: "M2.11104 4.9999C2.36691 4.9999 2.62291 5.09756 2.81791 5.29287L8.11104 10.5843L13.4048 5.29053C13.7954 4.8999 14.4282 4.8999 14.8188 5.29053C15.2095 5.68115 15.2095 6.31396 14.8188 6.70459L8.81885 12.7046C8.42822 13.0952 7.79541 13.0952 7.40479 12.7046L1.40479 6.70459C1.01416 6.31396 1.01416 5.68115 1.40479 5.29053C1.59854 5.09678 1.85479 4.9999 2.11104 4.9999Z", fill: "currentColor" })), k = (t) => /* @__PURE__ */ o.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ o.createElement("path", { d: "M13.8889 11C13.633 11 13.377 10.9023 13.182 10.707L7.8889 5.41563L2.59515 10.7094C2.20453 11.1 1.57172 11.1 1.18109 10.7094C0.790466 10.3188 0.790466 9.68594 1.18109 9.29532L7.18109 3.29532C7.57172 2.90469 8.20453 2.90469 8.59515 3.29532L14.5952 9.29532C14.9858 9.68594 14.9858 10.3188 14.5952 10.7094C14.4014 10.9031 14.1452 11 13.8889 11Z", fill: "#3F3D4B", fillOpacity: 0.88 })), A = y((t, a) => {
40
- const { children: i, disabled: r, className: n, "data-testid": d, prefix: s, onClick: h } = t, c = t["aria-expanded"];
41
- return /* @__PURE__ */ l(
42
- "button",
43
- {
44
- className: u(n, c ? e["select-button--active"] : "", e["select-button"]),
45
- type: "button",
46
- onClick: h,
47
- disabled: r,
48
- "data-testid": d,
49
- ref: a,
50
- children: [
51
- /* @__PURE__ */ l("span", { className: e["select-button__text"], children: [
52
- s && /* @__PURE__ */ _(p, { children: s }),
53
- /* @__PURE__ */ _(p, { children: i })
54
- ] }),
55
- /* @__PURE__ */ _("span", { className: e["select-button__icon"], children: c ? /* @__PURE__ */ _(k, {}) : /* @__PURE__ */ _(S, {}) })
56
- ]
57
- }
58
- );
59
- });
60
- export {
61
- A as S,
62
- e as s
63
- };