@phillips/seldon 1.57.1 → 1.58.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.
@@ -9,6 +9,7 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
9
9
  * The OOTB style to apply to the text
10
10
  */
11
11
  variant?: TextVariants;
12
+ superScript?: string;
12
13
  }
13
14
  /**
14
15
  * ## Overview
@@ -19,5 +20,5 @@ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
19
20
  *
20
21
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-text--overview)
21
22
  */
22
- declare const Text: ({ children, className, element: CustomElement, variant, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
23
+ declare const Text: ({ children, className, element: CustomElement, variant, superScript, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
23
24
  export default Text;
@@ -1,20 +1,30 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { getCommonProps as c } from "../../utils/index.js";
1
+ import { jsxs as i, jsx as p } from "react/jsx-runtime";
2
+ import { getCommonProps as x } from "../../utils/index.js";
3
3
  import { TextVariants as f } from "./types.js";
4
- import { determineDefaultTextElement as i, determineTextClassName as p } from "./utils.js";
5
- import x from "../../node_modules/classnames/index.js";
6
- const b = ({ children: t, className: o, element: s, variant: e = f.body2, ...m }) => {
7
- const r = s || i(e), { className: a, ...n } = c(m, "Text");
8
- return /* @__PURE__ */ l(
9
- r,
4
+ import { determineDefaultTextElement as d, determineTextClassName as N } from "./utils.js";
5
+ import o from "../../node_modules/classnames/index.js";
6
+ const j = ({
7
+ children: r,
8
+ className: a,
9
+ element: n,
10
+ variant: e = f.body2,
11
+ superScript: m = "",
12
+ ...s
13
+ }) => {
14
+ const l = n || d(e), { className: t, ...c } = x(s, "Text");
15
+ return /* @__PURE__ */ i(
16
+ l,
10
17
  {
11
- ...n,
12
- className: x(a, o, p(e)),
13
- ...m,
14
- children: t
18
+ ...c,
19
+ className: o(t, a, N(e)),
20
+ ...s,
21
+ children: [
22
+ r,
23
+ m ? /* @__PURE__ */ p("span", { className: o(`${t}--super-script`), children: m }) : null
24
+ ]
15
25
  }
16
26
  );
17
27
  };
18
28
  export {
19
- b as default
29
+ j as default
20
30
  };
@@ -27,3 +27,8 @@ h6.#{$px}-text {
27
27
  p.#{$px}-text {
28
28
  margin-bottom: $spacing-md;
29
29
  }
30
+ .#{$px}-text--super-script {
31
+ font-size: 60%;
32
+ margin-left: $spacing-xsm;
33
+ vertical-align: text-bottom;
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.57.1",
3
+ "version": "1.58.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"