@postenbring/hedwig-react
Advanced tools
Comparing version 0.0.0-badge-20231116111626 to 0.0.0-box-and-message-pEjLq4Vx-20231121222721
@@ -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'; |
@@ -56,2 +56,3 @@ "use strict"; | ||
module.exports = __toCommonJS(button_exports); | ||
var import_fonts = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css"); | ||
var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
@@ -63,3 +64,3 @@ var import_base = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_clsx = require("clsx"); | ||
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname.mjs"); | ||
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
@@ -104,4 +105,3 @@ // src/utils.ts | ||
}), | ||
ref: buttonRef, | ||
type: "button" | ||
ref: buttonRef | ||
}, rest), { | ||
@@ -108,0 +108,0 @@ children |
@@ -1,51 +0,9 @@ | ||
export { PrimaryButton, SecondaryButton } from './button/index.js'; | ||
import * as react_jsx_runtime from 'react/jsx-runtime'; | ||
import * as React from 'react'; | ||
interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "className" | "style"> { | ||
/** | ||
* The visual style of the link | ||
*/ | ||
variant?: "underline" | "solid" | "inverted" | "no-underline"; | ||
/** | ||
* Font size of the link | ||
*/ | ||
size?: "small" | "medium" | "large"; | ||
children: React.ReactNode; | ||
anchorRef?: React.ForwardedRef<HTMLAnchorElement>; | ||
} | ||
/** | ||
* ## TODO | ||
* | ||
* - [ ] Handle button styling | ||
*/ | ||
declare function Link({ children, variant, size, anchorRef, ...rest }: LinkProps): react_jsx_runtime.JSX.Element; | ||
declare namespace Link { | ||
var displayName: string; | ||
} | ||
interface BadgeProps extends Omit<React.AnchorHTMLAttributes<HTMLSpanElement>, "className" | "style"> { | ||
/** | ||
* Font size of the badge | ||
*/ | ||
size?: "small" | "smaller"; | ||
children: React.ReactNode; | ||
} | ||
declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element; | ||
declare namespace Badge { | ||
var displayName: string; | ||
} | ||
declare function DarkBadge(props: BadgeProps): react_jsx_runtime.JSX.Element; | ||
declare namespace DarkBadge { | ||
var displayName: string; | ||
} | ||
declare function WhiteBadge(props: BadgeProps): react_jsx_runtime.JSX.Element; | ||
declare namespace WhiteBadge { | ||
var displayName: string; | ||
} | ||
declare function WarningBadge(props: BadgeProps): react_jsx_runtime.JSX.Element; | ||
declare namespace WarningBadge { | ||
var displayName: string; | ||
} | ||
export { Badge, DarkBadge, Link, WarningBadge, WhiteBadge }; | ||
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'; | ||
export { DescriptionDetails, DescriptionDetailsProps, default as DescriptionList, DescriptionListProps, DescriptionTerm, DescriptionTermProps } from './list/description-list.js'; | ||
export { ListItem, ListItemProps, ListProps, OrderedList, UnorderedList } from './list/list.js'; | ||
export { a as Box, c as BoxCloseButton, b as BoxCloseButtonProps, B as BoxProps } from './index-OpbVH1tp.js'; | ||
export { Message, MessageProps } from './message/message.js'; | ||
import 'react/jsx-runtime'; | ||
import 'react'; |
@@ -53,6 +53,15 @@ "use strict"; | ||
Badge: () => Badge, | ||
Box: () => Box, | ||
BoxCloseButton: () => BoxCloseButton, | ||
DarkBadge: () => DarkBadge, | ||
DescriptionDetails: () => DescriptionDetails, | ||
DescriptionList: () => DescriptionList, | ||
DescriptionTerm: () => DescriptionTerm, | ||
Link: () => Link, | ||
ListItem: () => ListItem, | ||
Message: () => Message, | ||
OrderedList: () => OrderedList, | ||
PrimaryButton: () => PrimaryButton, | ||
SecondaryButton: () => SecondaryButton, | ||
UnorderedList: () => UnorderedList, | ||
WarningBadge: () => WarningBadge, | ||
@@ -64,2 +73,3 @@ WhiteBadge: () => WhiteBadge | ||
// src/button/index.tsx | ||
var import_fonts = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css"); | ||
var import_tokens = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
@@ -71,3 +81,3 @@ var import_base = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_clsx = require("clsx"); | ||
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname.mjs"); | ||
var import_typed_classname = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
@@ -112,4 +122,3 @@ // src/utils.ts | ||
}), | ||
ref: buttonRef, | ||
type: "button" | ||
ref: buttonRef | ||
}, rest), { | ||
@@ -131,2 +140,3 @@ children | ||
// src/link/index.tsx | ||
var import_fonts2 = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css"); | ||
var import_tokens2 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
@@ -138,3 +148,3 @@ var import_base2 = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_clsx2 = require("clsx"); | ||
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname.mjs"); | ||
var import_typed_classname2 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime2 = require("react/jsx-runtime"); | ||
@@ -171,2 +181,3 @@ function Link(_a) { | ||
// src/badge/index.tsx | ||
var import_fonts3 = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css"); | ||
var import_tokens3 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
@@ -178,3 +189,3 @@ var import_base3 = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_clsx3 = require("clsx"); | ||
var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname.mjs"); | ||
var import_typed_classname3 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime3 = require("react/jsx-runtime"); | ||
@@ -192,3 +203,10 @@ function BaseBadge(_a) { | ||
warnForStyleOverrides(rest); | ||
return /* @__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 }); | ||
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | ||
"span", | ||
__spreadProps(__spreadValues({ | ||
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}`)) | ||
}, rest), { | ||
children | ||
}) | ||
); | ||
} | ||
@@ -211,12 +229,213 @@ BaseBadge.displayName = "BaseBadge"; | ||
} | ||
WarningBadge.displayName = "Badge"; | ||
WarningBadge.displayName = "WarningBadge"; | ||
// src/list/index.tsx | ||
var import_fonts4 = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css"); | ||
var import_tokens4 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
var import_base4 = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_description_list = require("@postenbring/hedwig-css/dist/list/description-list.css"); | ||
var import_list = require("@postenbring/hedwig-css/dist/list/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"]); | ||
warnForStyleOverrides(rest); | ||
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dd", __spreadProps(__spreadValues({}, rest), { children })); | ||
} | ||
function DescriptionTerm(_a) { | ||
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]); | ||
warnForStyleOverrides(rest); | ||
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("dt", __spreadProps(__spreadValues({}, rest), { children })); | ||
} | ||
function DescriptionList(_a) { | ||
var _b = _a, { variant = "vertical" } = _b, rest = __objRest(_b, ["variant"]); | ||
warnForStyleOverrides(rest); | ||
return /* @__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"; | ||
// src/list/list.tsx | ||
var import_clsx5 = require("clsx"); | ||
var import_typed_classname5 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime5 = require("react/jsx-runtime"); | ||
function BaseList(_a) { | ||
var _b = _a, { | ||
as: ListTag = "ul", | ||
children, | ||
listStyle = "inherit", | ||
size = "medium" | ||
} = _b, rest = __objRest(_b, [ | ||
"as", | ||
"children", | ||
"listStyle", | ||
"size" | ||
]); | ||
warnForStyleOverrides(rest); | ||
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( | ||
ListTag, | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx5.clsx)((0, import_typed_classname5.t)("hds-list"), (0, import_typed_classname5.t)(`hds-list--${size}`), { | ||
[(0, import_typed_classname5.t)(`hds-list--style-hidden`)]: listStyle === "no-bullets" | ||
}) | ||
}, rest), { | ||
children | ||
}) | ||
); | ||
} | ||
function ListItem(_a) { | ||
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]); | ||
warnForStyleOverrides(rest); | ||
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", __spreadProps(__spreadValues({}, rest), { children })); | ||
} | ||
function UnorderedList(props) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BaseList, __spreadProps(__spreadValues({ as: "ul" }, props), { children: props.children })); | ||
} | ||
function OrderedList(props) { | ||
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BaseList, __spreadProps(__spreadValues({ as: "ol" }, props), { children: props.children })); | ||
} | ||
ListItem.displayName = "ListItem"; | ||
BaseList.displayName = "BaseList"; | ||
OrderedList.displayName = "UnorderedList"; | ||
UnorderedList.displayName = "UnorderedList"; | ||
// src/box/index.tsx | ||
var import_fonts5 = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css"); | ||
var import_tokens5 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
var import_base5 = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_box = require("@postenbring/hedwig-css/dist/box/box.css"); | ||
var import_message = require("@postenbring/hedwig-css/dist/box/message.css"); | ||
// src/box/box.tsx | ||
var import_react = require("react"); | ||
var import_clsx6 = require("clsx"); | ||
var import_typed_classname6 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime6 = require("react/jsx-runtime"); | ||
var Box = (0, import_react.forwardRef)( | ||
(_a, ref) => { | ||
var _b = _a, { | ||
as: Component = "div", | ||
variant = "light-grey", | ||
hideCloseButton, | ||
onClose: onCloseProp, | ||
closed: closedProp, | ||
closeButtonProps, | ||
children, | ||
className | ||
} = _b, rest = __objRest(_b, [ | ||
"as", | ||
"variant", | ||
"hideCloseButton", | ||
"onClose", | ||
"closed", | ||
"closeButtonProps", | ||
"children", | ||
"className" | ||
]); | ||
const [closedState, setClosedState] = (0, import_react.useState)(false); | ||
const onClose = (0, import_react.useCallback)(() => { | ||
if (onCloseProp) { | ||
const result = onCloseProp(); | ||
if (result === true) { | ||
setClosedState(true); | ||
} | ||
} else { | ||
setClosedState(true); | ||
} | ||
}, []); | ||
const closed = closedProp != null ? closedProp : closedState; | ||
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)( | ||
Component, | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx6.clsx)( | ||
(0, import_typed_classname6.t)("hds-box"), | ||
(0, import_typed_classname6.t)(`hds-box--${variant}`), | ||
{ [(0, import_typed_classname6.t)("hds-box--closed")]: closed }, | ||
className | ||
), | ||
ref | ||
}, rest), { | ||
children: [ | ||
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(BoxCloseButton, __spreadValues({ onClick: onClose }, closeButtonProps)), | ||
children | ||
] | ||
}) | ||
); | ||
} | ||
); | ||
Box.displayName = "Box"; | ||
var BoxCloseButton = (0, import_react.forwardRef)( | ||
(_a, ref) => { | ||
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]); | ||
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( | ||
"button", | ||
__spreadValues({ | ||
className: (0, import_clsx6.clsx)((0, import_typed_classname6.t)("hds-box__close-button"), className), | ||
ref, | ||
type: "button" | ||
}, rest) | ||
); | ||
} | ||
); | ||
BoxCloseButton.displayName = "BoxCloseButton"; | ||
// src/message/index.tsx | ||
var import_fonts6 = require("@postenbring/hedwig-tokens/tokens-output/css/fonts.css"); | ||
var import_tokens6 = require("@postenbring/hedwig-tokens/tokens-output/css/tokens.css"); | ||
var import_base6 = require("@postenbring/hedwig-css/dist/base.css"); | ||
var import_box3 = require("@postenbring/hedwig-css/dist/box/box.css"); | ||
var import_message2 = require("@postenbring/hedwig-css/dist/message/message.css"); | ||
// src/message/message.tsx | ||
var import_react2 = require("react"); | ||
var import_clsx7 = require("clsx"); | ||
var import_typed_classname7 = require("@postenbring/hedwig-css/typed-classname/index.mjs"); | ||
var import_jsx_runtime7 = require("react/jsx-runtime"); | ||
var Message = (0, import_react2.forwardRef)( | ||
(_a, ref) => { | ||
var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]); | ||
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)( | ||
Box, | ||
__spreadProps(__spreadValues({ | ||
className: (0, import_clsx7.clsx)((0, import_typed_classname7.t)(`hds-message`), (0, import_typed_classname7.t)(`hds-message--${variant}`), className), | ||
ref | ||
}, rest), { | ||
children: [ | ||
variant === "neutral" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_clsx7.clsx)((0, import_typed_classname7.t)("hds-message--neutral__icon"), iconClassName), children: icon }), | ||
children | ||
] | ||
}) | ||
); | ||
} | ||
); | ||
Message.displayName = "Message"; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
Badge, | ||
Box, | ||
BoxCloseButton, | ||
DarkBadge, | ||
DescriptionDetails, | ||
DescriptionList, | ||
DescriptionTerm, | ||
Link, | ||
ListItem, | ||
Message, | ||
OrderedList, | ||
PrimaryButton, | ||
SecondaryButton, | ||
UnorderedList, | ||
WarningBadge, | ||
WhiteBadge | ||
}); |
{ | ||
"name": "@postenbring/hedwig-react", | ||
"version": "0.0.0-badge-20231116111626", | ||
"version": "0.0.0-box-and-message-pEjLq4Vx-20231121222721", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"sideEffects": false, | ||
"sideEffects": true, | ||
"license": "MIT", | ||
@@ -25,8 +25,8 @@ "files": [ | ||
"react": "^18.2.0", | ||
"tsup": "^7.2.0", | ||
"tsup": "^7.3.0", | ||
"typescript": "^5.2.2" | ||
}, | ||
"dependencies": { | ||
"@postenbring/hedwig-css": "0.0.0-badge-20231116111626", | ||
"@postenbring/hedwig-tokens": "*", | ||
"@postenbring/hedwig-css": "0.0.0-box-and-message-pEjLq4Vx-20231121222721", | ||
"@postenbring/hedwig-tokens": "0.0.0-box-and-message-pEjLq4Vx-20231121222721", | ||
"clsx": "^2.0.0" | ||
@@ -33,0 +33,0 @@ }, |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
111180
73
2913
2
1
+ Added@parcel/watcher-linux-x64-glibc@2.5.0(transitive)
+ Added@postenbring/hedwig-css@0.0.0-box-and-message-pEjLq4Vx-20231121222721(transitive)
+ Added@postenbring/hedwig-tokens@0.0.0-box-and-message-pEjLq4Vx-20231121222721(transitive)
- Removed@postenbring/hedwig-css@0.0.0-badge-20231116111626(transitive)
- Removed@postenbring/hedwig-tokens@1.1.0(transitive)
Updated@postenbring/hedwig-css@0.0.0-box-and-message-pEjLq4Vx-20231121222721
Updated@postenbring/hedwig-tokens@0.0.0-box-and-message-pEjLq4Vx-20231121222721