najwer23morsels 1.6.0 → 1.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # najwer23morsels
2
2
 
3
+ ## 1.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Typography
8
+
9
+ ## 1.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ButtonCopy
14
+
3
15
  ## 1.6.0
4
16
 
5
17
  ### Minor Changes
@@ -1,9 +1,9 @@
1
- interface CopyButtonProps extends React.HTMLAttributes<HTMLDivElement> {
1
+ interface ButtonCopyProps extends React.HTMLAttributes<HTMLDivElement> {
2
2
  children?: React.ReactNode;
3
3
  style?: React.CSSProperties;
4
4
  backgroundColor?: string;
5
5
  color?: string;
6
6
  textToCopy: string;
7
7
  }
8
- export declare const CopyButton: React.FC<CopyButtonProps>;
8
+ export declare const ButtonCopy: React.FC<ButtonCopyProps>;
9
9
  export {};
@@ -0,0 +1,2 @@
1
+ import { ButtonCopy } from './ButtonCopy';
2
+ export { ButtonCopy };
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useState as o,useRef as r,useCallback as e,useEffect as i}from"react";import{B as n}from"./Button-B93Rn5W6.js";import{T as c}from"./TextBox-__k4jPYK.js";import"./Loader-BPh2L4dp.js";import"./LoaderDots-BoEg_zlZ.js";import"./style-inject.es-CrVRO2OA.js";const l=({children:l,className:a,style:s,textToCopy:u,color:m="white",backgroundColor:p="orangered",...d})=>{const[h,x]=o(!1),g=r(null),j=e(()=>{g.current&&clearTimeout(g.current),navigator.clipboard.writeText(u),x(!0),g.current=setTimeout(()=>{x(!1),g.current=null},800)},[]);return i(()=>()=>{g.current&&clearTimeout(g.current)},[]),t("div",{className:["n23mCopyButton",a].filter(Boolean).join(" "),...d,children:t(n,{type:"button",padding:"0px 3px",height:"auto",width:"auto",backgroundColor:h?"#4BB543":p,onClick:j,children:l??t(c,{mobileSize:10,desktopSize:10,fontWeight:600,lineHeight:"17px",color:m,children:"Copy"})})})};l.displayName="CopyButton";export{l as CopyButton};
1
+ import{jsx as t}from"react/jsx-runtime";import{useState as o,useRef as r,useCallback as e,useEffect as i}from"react";import{B as n}from"./Button-B93Rn5W6.js";import{T as c}from"./TextBox-__k4jPYK.js";import"./Loader-BPh2L4dp.js";import"./LoaderDots-BoEg_zlZ.js";import"./style-inject.es-CrVRO2OA.js";const l=({children:l,className:a,style:s,textToCopy:u,color:m="white",backgroundColor:p="orangered",...d})=>{const[h,x]=o(!1),g=r(null),j=e(()=>{g.current&&clearTimeout(g.current),navigator.clipboard.writeText(u),x(!0),g.current=setTimeout(()=>{x(!1),g.current=null},800)},[]);return i(()=>()=>{g.current&&clearTimeout(g.current)},[]),t("div",{className:["n23mButtonCopy",a].filter(Boolean).join(" "),...d,children:t(n,{type:"button",padding:"0px 3px",height:"auto",width:"auto",backgroundColor:h?"#4BB543":p,onClick:j,children:l??t(c,{mobileSize:10,desktopSize:10,fontWeight:600,lineHeight:"17px",color:m,children:"Copy"})})})};l.displayName="ButtonCopy";export{l as ButtonCopy};
@@ -1,7 +1,7 @@
1
- type TextBoxOwnProps = {
1
+ export type TextBoxOwnProps = {
2
2
  children?: React.ReactNode;
3
- mobileSize: number;
4
- desktopSize: number;
3
+ mobileSize: number | 'inherit';
4
+ desktopSize: number | 'inherit';
5
5
  lineHeight?: number | string;
6
6
  color?: React.CSSProperties['color'];
7
7
  colorHover?: React.CSSProperties['color'];
@@ -1,2 +1,2 @@
1
- import { TextBox } from './TextBox';
2
- export { TextBox };
1
+ import { TextBox, type TextBoxOwnProps } from './TextBox';
2
+ export { TextBox, type TextBoxOwnProps };
@@ -0,0 +1,21 @@
1
+ import { type TextBoxOwnProps } from '../TextBox';
2
+ export type TypographyVariant = 'display' | 'heading' | 'subheading' | 'body' | 'caption' | 'link';
3
+ export type TypographyAppearance = 'light' | 'dark';
4
+ type TypographyPreset = Omit<TextBoxOwnProps, 'children'> & {
5
+ tag?: React.ElementType;
6
+ letterSpacing?: React.CSSProperties['letterSpacing'];
7
+ };
8
+ type TypographyProps = Partial<TypographyPreset> & {
9
+ variant: TypographyVariant;
10
+ appearance?: TypographyAppearance;
11
+ children?: React.ReactNode;
12
+ className?: string;
13
+ href?: string;
14
+ target?: React.HTMLAttributeAnchorTarget;
15
+ rel?: string;
16
+ };
17
+ export declare const Typography: {
18
+ ({ variant, appearance, style, color, colorHover, ...overrides }: TypographyProps): import("react").JSX.Element;
19
+ displayName: string;
20
+ };
21
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Typography } from './Typography';
2
+ export { Typography };
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{T as o}from"./TextBox-__k4jPYK.js";import"./style-inject.es-CrVRO2OA.js";const i={display:{tag:"h1",mobileSize:42,desktopSize:76,lineHeight:1.05,fontWeight:700,textWrap:"balance",margin:"clamp(40px, 8vw, 60px) 0 10px"},heading:{tag:"h2",mobileSize:30,desktopSize:52,fontWeight:650,lineHeight:1.1,textWrap:"balance",margin:"clamp(30px, 8vw, 40px) 0 5px"},subheading:{tag:"h3",mobileSize:20,desktopSize:26,lineHeight:1.25,fontWeight:500,margin:"30px 0 0"},body:{tag:"p",mobileSize:16,desktopSize:17,fontWeight:400,margin:"10px 0 0"},caption:{tag:"span",mobileSize:11,desktopSize:12,lineHeight:1,fontWeight:600,margin:0,style:{textTransform:"uppercase"}},link:{tag:"a",mobileSize:"inherit",desktopSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit",margin:0}},t={light:{display:{color:"#0F1014"},heading:{color:"#14151A"},subheading:{color:"#3f4043"},body:{color:"#26272E"},caption:{color:"#6B6D76"},link:{color:"orangered",hover:"orangered"}},dark:{display:{color:"#FFFFFF"},heading:{color:"#F7F8FA"},subheading:{color:"#9A9DAA"},body:{color:"#F7F7F8"},caption:{color:"#9A9DAA"},link:{color:"orangered",hover:"orangered"}}},r=({variant:r,appearance:a="light",style:n,color:l,colorHover:p,...g})=>{const c=i[r],h=t[a][r];return e(o,{...c,...g,color:l??h.color,colorHover:p??h.hover,style:{...c.style,...n}})};r.displayName="Typography";export{r as Typography};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najwer23morsels",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.ts",
@@ -1,2 +0,0 @@
1
- import { CopyButton } from './CopyButton';
2
- export { CopyButton };