@postenbring/hedwig-react
Advanced tools
Comparing version 0.0.0-link-component-20231112202102 to 0.0.0-nQUf1bl4-description-list-20231116194057
@@ -1,37 +0,3 @@ | ||
import * as react_jsx_runtime from 'react/jsx-runtime'; | ||
import * as React from 'react'; | ||
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> { | ||
/** | ||
* The height, font size and padding of the button | ||
*/ | ||
size?: "small" | "medium" | "large"; | ||
/** | ||
* Make the button use 100% width available. | ||
* Using the "mobile" it only stretch to full width on smaller screens | ||
*/ | ||
fullWidth?: boolean | "mobile"; | ||
/** | ||
* The background of the button. | ||
*/ | ||
fill?: "contained" | "outlined"; | ||
children: React.ReactNode; | ||
buttonRef?: React.ForwardedRef<HTMLButtonElement>; | ||
} | ||
/** | ||
* ## TODO | ||
* | ||
* - [ ] Handle links that looks like buttons | ||
* - [ ] Revisit how to handle outline | ||
* - [ ] Figure out outline-white | ||
*/ | ||
declare function PrimaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element; | ||
declare namespace PrimaryButton { | ||
var displayName: string; | ||
} | ||
declare function SecondaryButton(props: ButtonProps): react_jsx_runtime.JSX.Element; | ||
declare namespace SecondaryButton { | ||
var displayName: string; | ||
} | ||
export { PrimaryButton, SecondaryButton }; | ||
export { ButtonProps, PrimaryButton, SecondaryButton } from './button.js'; | ||
import 'react/jsx-runtime'; | ||
import 'react'; |
@@ -62,4 +62,9 @@ "use strict"; | ||
var import_clsx = require("clsx"); | ||
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
// src/utils.ts | ||
function warnForStyleOverridesAndRender(props, component) { | ||
warnForStyleOverrides(props); | ||
return component; | ||
} | ||
function warnForStyleOverrides(props) { | ||
@@ -92,17 +97,18 @@ if (props.className) { | ||
]); | ||
warnForStyleOverrides(rest); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
"button", | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx.clsx)("hds-button", `hds-button--${size}`, { | ||
[`hds-button--${variant}`]: fill === "contained", | ||
[`hds-button--outline-${variant}`]: fill === "outlined", | ||
"hds-button--full": fullWidth === true, | ||
"hds-button--mobile-full": fullWidth === "mobile" | ||
}), | ||
ref: buttonRef, | ||
type: "button" | ||
}, rest), { | ||
children | ||
}) | ||
return warnForStyleOverridesAndRender( | ||
rest, | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
"button", | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-button"), (0, import_typed_classname.t)(`hds-button--${size}`), { | ||
[(0, import_typed_classname.t)(`hds-button--${variant}`)]: fill === "contained", | ||
[(0, import_typed_classname.t)(`hds-button--outline-${variant}`)]: fill === "outlined", | ||
[(0, import_typed_classname.t)("hds-button--full")]: fullWidth === true, | ||
[(0, import_typed_classname.t)("hds-button--mobile-full")]: fullWidth === "mobile" | ||
}), | ||
ref: buttonRef | ||
}, rest), { | ||
children | ||
}) | ||
) | ||
); | ||
@@ -109,0 +115,0 @@ } |
@@ -1,27 +0,31 @@ | ||
export { PrimaryButton, SecondaryButton } from './button/index.js'; | ||
import * as react_jsx_runtime from 'react/jsx-runtime'; | ||
import * as React from 'react'; | ||
export { ButtonProps, PrimaryButton, SecondaryButton } from './button/button.js'; | ||
export { Link, LinkProps } from './link/link.js'; | ||
export { Badge, BadgeProps, DarkBadge, WarningBadge, WhiteBadge } from './badge/badge.js'; | ||
import React__default, { ReactNode, HTMLAttributes } from 'react'; | ||
import 'react/jsx-runtime'; | ||
interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "className" | "style"> { | ||
type DDProps = DLDTProps; | ||
type DTProps = DLDTProps; | ||
interface DLDTProps extends Omit<React__default.HTMLAttributes<HTMLBaseElement>, "className" | "style"> { | ||
children: ReactNode; | ||
} | ||
interface DLProps extends Omit<HTMLAttributes<HTMLDListElement>, "className" | "style"> { | ||
/** | ||
* The visual style of the link | ||
* Direction of the description list | ||
*/ | ||
variant?: "underline" | "solid" | "inverted" | "no-underline"; | ||
/** | ||
* Font size of the link | ||
*/ | ||
size?: "small" | "medium" | "large"; | ||
children: React.ReactNode; | ||
anchorRef?: React.ForwardedRef<HTMLAnchorElement>; | ||
variant?: "vertical" | "horizontal"; | ||
} | ||
/** | ||
* ## TODO | ||
* | ||
* - [ ] Handle button styling | ||
*/ | ||
declare function Link({ children, variant, size, anchorRef, ...rest }: LinkProps): react_jsx_runtime.JSX.Element; | ||
declare namespace Link { | ||
declare function DescriptionDetails({ children, ...rest }: DDProps): React__default.JSX.Element; | ||
declare namespace DescriptionDetails { | ||
var displayName: string; | ||
} | ||
declare function DescriptionTerm({ children, ...rest }: DTProps): React__default.JSX.Element; | ||
declare namespace DescriptionTerm { | ||
var displayName: string; | ||
} | ||
declare function DescriptionList({ variant, ...rest }: DLProps): React__default.JSX.Element; | ||
declare namespace DescriptionList { | ||
var displayName: string; | ||
} | ||
export { Link }; | ||
export { DescriptionDetails, DescriptionList, DescriptionTerm }; |
@@ -52,17 +52,24 @@ "use strict"; | ||
__export(src_exports, { | ||
Badge: () => Badge, | ||
DarkBadge: () => DarkBadge, | ||
DescriptionDetails: () => DescriptionDetails, | ||
DescriptionList: () => DescriptionList, | ||
DescriptionTerm: () => DescriptionTerm, | ||
Link: () => Link, | ||
PrimaryButton: () => PrimaryButton, | ||
SecondaryButton: () => SecondaryButton | ||
SecondaryButton: () => SecondaryButton, | ||
WarningBadge: () => WarningBadge, | ||
WhiteBadge: () => WhiteBadge | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/button/index.tsx | ||
var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
var import_base = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_button = require("@postenbring/hedwig-css/dist/button/button.css"); | ||
// src/button/button.tsx | ||
var import_clsx = require("clsx"); | ||
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
// src/utils.ts | ||
function warnForStyleOverridesAndRender(props, component) { | ||
warnForStyleOverrides(props); | ||
return component; | ||
} | ||
function warnForStyleOverrides(props) { | ||
@@ -95,17 +102,18 @@ if (props.className) { | ||
]); | ||
warnForStyleOverrides(rest); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
"button", | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx.clsx)("hds-button", `hds-button--${size}`, { | ||
[`hds-button--${variant}`]: fill === "contained", | ||
[`hds-button--outline-${variant}`]: fill === "outlined", | ||
"hds-button--full": fullWidth === true, | ||
"hds-button--mobile-full": fullWidth === "mobile" | ||
}), | ||
ref: buttonRef, | ||
type: "button" | ||
}, rest), { | ||
children | ||
}) | ||
return warnForStyleOverridesAndRender( | ||
rest, | ||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
"button", | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx.clsx)((0, import_typed_classname.t)("hds-button"), (0, import_typed_classname.t)(`hds-button--${size}`), { | ||
[(0, import_typed_classname.t)(`hds-button--${variant}`)]: fill === "contained", | ||
[(0, import_typed_classname.t)(`hds-button--outline-${variant}`)]: fill === "outlined", | ||
[(0, import_typed_classname.t)("hds-button--full")]: fullWidth === true, | ||
[(0, import_typed_classname.t)("hds-button--mobile-full")]: fullWidth === "mobile" | ||
}), | ||
ref: buttonRef | ||
}, rest), { | ||
children | ||
}) | ||
) | ||
); | ||
@@ -123,9 +131,5 @@ } | ||
// src/link/index.tsx | ||
var import_tokens2 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
var import_base2 = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_link = require("@postenbring/hedwig-css/dist/link/link.css"); | ||
// src/link/link.tsx | ||
var import_clsx2 = require("clsx"); | ||
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime2 = require("react/jsx-runtime"); | ||
@@ -144,22 +148,104 @@ function Link(_a) { | ||
]); | ||
warnForStyleOverrides(rest); | ||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( | ||
"a", | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx2.clsx)("hds-link", { | ||
[`hds-link--${variant}`]: variant !== "underline", | ||
[`hds-link--${size}`]: size !== "medium" | ||
}), | ||
ref: anchorRef | ||
}, rest), { | ||
children | ||
}) | ||
return warnForStyleOverridesAndRender( | ||
rest, | ||
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)( | ||
"a", | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx2.clsx)( | ||
(0, import_typed_classname2.t)("hds-link"), | ||
variant !== "underline" && (0, import_typed_classname2.t)(`hds-link--${variant}`), | ||
size !== "medium" && (0, import_typed_classname2.t)(`hds-link--${size}`) | ||
), | ||
ref: anchorRef | ||
}, rest), { | ||
children | ||
}) | ||
) | ||
); | ||
} | ||
Link.displayName = "Link"; | ||
// src/badge/badge.tsx | ||
var import_clsx3 = require("clsx"); | ||
var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime3 = require("react/jsx-runtime"); | ||
function BaseBadge(_a) { | ||
var _b = _a, { | ||
children, | ||
variant, | ||
size = "small" | ||
} = _b, rest = __objRest(_b, [ | ||
"children", | ||
"variant", | ||
"size" | ||
]); | ||
return warnForStyleOverridesAndRender( | ||
rest, | ||
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx3.clsx)((0, import_typed_classname3.t)("hds-badge"), (0, import_typed_classname3.t)(`hds-badge--${size}`), (0, import_typed_classname3.t)(`hds-badge--${variant}`)), children }) | ||
); | ||
} | ||
BaseBadge.displayName = "BaseBadge"; | ||
function Badge(props) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "primary" })); | ||
} | ||
Badge.displayName = "Badge"; | ||
function DarkBadge(props) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "dark" })); | ||
} | ||
DarkBadge.displayName = "DarkBadge"; | ||
function WhiteBadge(props) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "white" })); | ||
} | ||
WhiteBadge.displayName = "WhiteBadge"; | ||
function WarningBadge(props) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BaseBadge, __spreadProps(__spreadValues({}, props), { variant: "warning" })); | ||
} | ||
WarningBadge.displayName = "WarningBadge"; | ||
// src/list/index.tsx | ||
var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
var import_base = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_description_list = require("@postenbring/hedwig-css/dist/list/description-list.css"); | ||
// src/list/description-list.tsx | ||
var import_clsx4 = require("clsx"); | ||
var import_typed_classname4 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime4 = require("react/jsx-runtime"); | ||
function DescriptionDetails(_a) { | ||
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]); | ||
return warnForStyleOverridesAndRender(rest, /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", __spreadProps(__spreadValues({}, rest), { children }))); | ||
} | ||
function DescriptionTerm(_a) { | ||
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]); | ||
return warnForStyleOverridesAndRender(rest, /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", __spreadProps(__spreadValues({}, rest), { children }))); | ||
} | ||
function DescriptionList(_a) { | ||
var _b = _a, { variant = "vertical" } = _b, rest = __objRest(_b, ["variant"]); | ||
return warnForStyleOverridesAndRender( | ||
rest, | ||
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | ||
"dl", | ||
__spreadValues({ | ||
className: (0, import_clsx4.clsx)((0, import_typed_classname4.t)("hds-description-list"), { | ||
[(0, import_typed_classname4.t)("hds-description-list--horizontal")]: variant === "horizontal" | ||
}) | ||
}, rest) | ||
) | ||
); | ||
} | ||
DescriptionList.displayName = "DescriptionList"; | ||
DescriptionTerm.displayName = "DescriptionTerm"; | ||
DescriptionDetails.displayName = "DescriptionDetails"; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
Badge, | ||
DarkBadge, | ||
DescriptionDetails, | ||
DescriptionList, | ||
DescriptionTerm, | ||
Link, | ||
PrimaryButton, | ||
SecondaryButton | ||
SecondaryButton, | ||
WarningBadge, | ||
WhiteBadge | ||
}); |
{ | ||
"name": "@postenbring/hedwig-react", | ||
"version": "0.0.0-link-component-20231112202102", | ||
"version": "0.0.0-nQUf1bl4-description-list-20231116194057", | ||
"main": "./dist/index.js", | ||
@@ -29,5 +29,5 @@ "module": "./dist/index.mjs", | ||
"dependencies": { | ||
"@postenbring/hedwig-css": "0.0.0-link-component-20231112202102", | ||
"@postenbring/hedwig-tokens": "0.0.0-link-component-20231112202102", | ||
"clsx": "2.0.0" | ||
"@postenbring/hedwig-css": "0.0.0-nQUf1bl4-description-list-20231116194057", | ||
"@postenbring/hedwig-tokens": "0.0.0-nQUf1bl4-description-list-20231116194057", | ||
"clsx": "^2.0.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52720
36
1380
1
+ Added@parcel/watcher-linux-x64-glibc@2.5.0(transitive)
+ Added@postenbring/hedwig-css@0.0.0-nQUf1bl4-description-list-20231116194057(transitive)
+ Added@postenbring/hedwig-tokens@0.0.0-nQUf1bl4-description-list-20231116194057(transitive)
+ Addedclsx@2.1.1(transitive)
- Removed@postenbring/hedwig-css@0.0.0-link-component-20231112202102(transitive)
- Removed@postenbring/hedwig-tokens@0.0.0-link-component-20231112202102(transitive)
- Removedclsx@2.0.0(transitive)
Updated@postenbring/hedwig-css@0.0.0-nQUf1bl4-description-list-20231116194057
Updated@postenbring/hedwig-tokens@0.0.0-nQUf1bl4-description-list-20231116194057
Updatedclsx@^2.0.0