@discuss-ds/ui 0.41.0 → 0.42.1
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 +14 -0
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -745,8 +745,10 @@ interface MediaInfoProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tit
|
|
|
745
745
|
large?: boolean;
|
|
746
746
|
/** Buttons on the name's line, at its right, e.g. a small ghost "more" button. */
|
|
747
747
|
actions?: React.ReactNode;
|
|
748
|
+
/** 16px padding all round instead of 16px top and bottom and 24px at the sides, for small cards. */
|
|
749
|
+
compact?: boolean;
|
|
748
750
|
}
|
|
749
|
-
declare function MediaInfo({ name, details, onRemove, removeLabel, large, actions, className, ...props }: MediaInfoProps): React.JSX.Element;
|
|
751
|
+
declare function MediaInfo({ name, details, onRemove, removeLabel, large, actions, compact, className, ...props }: MediaInfoProps): React.JSX.Element;
|
|
750
752
|
interface ImagePreviewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
751
753
|
/** The image (an `<img>`). The preview area is as tall as the image at full width, up to 336px. Leave empty for the fixed-height placeholder fill. */
|
|
752
754
|
children?: React.ReactNode;
|
|
@@ -784,6 +786,10 @@ interface VideoPlayerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 't
|
|
|
784
786
|
moreIn?: 'controls' | 'info';
|
|
785
787
|
/** Laid over the top-left corner of the video, e.g. a `Tag` with the clip's sentiment. */
|
|
786
788
|
badge?: React.ReactNode;
|
|
789
|
+
/** `fixed` (default) keeps the 242px preview area; `video` makes it 16:9 (Full HD proportions) at whatever width the player has. */
|
|
790
|
+
aspect?: 'fixed' | 'video';
|
|
791
|
+
/** The name and details below the video with 16px padding all round (`MediaInfo compact`). */
|
|
792
|
+
compactInfo?: boolean;
|
|
787
793
|
}
|
|
788
794
|
declare const VideoPlayer: React.ForwardRefExoticComponent<VideoPlayerProps & React.RefAttributes<HTMLDivElement>>;
|
|
789
795
|
interface VolumeControlProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -745,8 +745,10 @@ interface MediaInfoProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tit
|
|
|
745
745
|
large?: boolean;
|
|
746
746
|
/** Buttons on the name's line, at its right, e.g. a small ghost "more" button. */
|
|
747
747
|
actions?: React.ReactNode;
|
|
748
|
+
/** 16px padding all round instead of 16px top and bottom and 24px at the sides, for small cards. */
|
|
749
|
+
compact?: boolean;
|
|
748
750
|
}
|
|
749
|
-
declare function MediaInfo({ name, details, onRemove, removeLabel, large, actions, className, ...props }: MediaInfoProps): React.JSX.Element;
|
|
751
|
+
declare function MediaInfo({ name, details, onRemove, removeLabel, large, actions, compact, className, ...props }: MediaInfoProps): React.JSX.Element;
|
|
750
752
|
interface ImagePreviewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
751
753
|
/** The image (an `<img>`). The preview area is as tall as the image at full width, up to 336px. Leave empty for the fixed-height placeholder fill. */
|
|
752
754
|
children?: React.ReactNode;
|
|
@@ -784,6 +786,10 @@ interface VideoPlayerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 't
|
|
|
784
786
|
moreIn?: 'controls' | 'info';
|
|
785
787
|
/** Laid over the top-left corner of the video, e.g. a `Tag` with the clip's sentiment. */
|
|
786
788
|
badge?: React.ReactNode;
|
|
789
|
+
/** `fixed` (default) keeps the 242px preview area; `video` makes it 16:9 (Full HD proportions) at whatever width the player has. */
|
|
790
|
+
aspect?: 'fixed' | 'video';
|
|
791
|
+
/** The name and details below the video with 16px padding all round (`MediaInfo compact`). */
|
|
792
|
+
compactInfo?: boolean;
|
|
787
793
|
}
|
|
788
794
|
declare const VideoPlayer: React.ForwardRefExoticComponent<VideoPlayerProps & React.RefAttributes<HTMLDivElement>>;
|
|
789
795
|
interface VolumeControlProps {
|
package/dist/index.js
CHANGED
|
@@ -1126,7 +1126,7 @@ TabNavigation.displayName = "TabNavigation";
|
|
|
1126
1126
|
// src/components/Navigation/TabItem.tsx
|
|
1127
1127
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1128
1128
|
var base = "inline-flex h-7 items-center justify-center gap-1 whitespace-nowrap px-2.5 py-1 text-ui-label transition-colors disabled:pointer-events-none disabled:opacity-50";
|
|
1129
|
-
var filter = "relative rounded-full text-surface-foreground hover:text-accent data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground";
|
|
1129
|
+
var filter = "relative rounded-full text-surface-foreground hover:text-accent-foreground data-[state=active]:hover:bg-accent-soft data-[state=active]:hover:text-accent-soft-foreground disabled:text-muted-foreground";
|
|
1130
1130
|
var toggle = "relative rounded-sm text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:text-surface-foreground";
|
|
1131
1131
|
var underline = "relative h-full rounded-none px-4 py-3 font-medium text-secondary-muted-foreground hover:text-surface-foreground data-[state=active]:font-semibold data-[state=active]:text-surface-foreground after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 data-[state=active]:after:bg-accent";
|
|
1132
1132
|
var TabItem = React20.forwardRef(
|
|
@@ -2808,8 +2808,8 @@ import * as React42 from "react";
|
|
|
2808
2808
|
import { CornersOut, DotsThree, DotsThreeVertical, Image as ImageIcon, Pause, Play, SpeakerSimpleHigh, SpeakerSimpleX, Trash as Trash3 } from "@phosphor-icons/react";
|
|
2809
2809
|
import { Slider as SliderPrimitive2, ToggleGroup as ToggleGroupPrimitive2 } from "radix-ui";
|
|
2810
2810
|
import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2811
|
-
function MediaInfo({ name, details, onRemove, removeLabel, large, actions, className, ...props }) {
|
|
2812
|
-
return /* @__PURE__ */ jsxs33("div", { className: cn("flex items-center justify-between border-t border-border bg-surface px-6 py-4", className), ...props, children: [
|
|
2811
|
+
function MediaInfo({ name, details, onRemove, removeLabel, large, actions, compact = false, className, ...props }) {
|
|
2812
|
+
return /* @__PURE__ */ jsxs33("div", { className: cn("flex items-center justify-between border-t border-border bg-surface", compact ? "p-4" : "px-6 py-4", className), ...props, children: [
|
|
2813
2813
|
/* @__PURE__ */ jsxs33("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2814
2814
|
/* @__PURE__ */ jsxs33("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2815
2815
|
/* @__PURE__ */ jsx43("p", { className: cn("min-w-0 flex-1 truncate text-surface-foreground", large ? "text-body-section" : "text-ui-label"), children: name }),
|
|
@@ -2887,7 +2887,7 @@ var formatTime = (seconds) => {
|
|
|
2887
2887
|
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
2888
2888
|
};
|
|
2889
2889
|
var VideoPlayer = React42.forwardRef(
|
|
2890
|
-
({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, controls = "always", moreIn = "controls", badge, ...props }, ref) => {
|
|
2890
|
+
({ className, src, name, details, onRemove, onMore, initialTime = 0, initialDuration = 0, controls = "always", moreIn = "controls", badge, aspect = "fixed", compactInfo = false, ...props }, ref) => {
|
|
2891
2891
|
const video = React42.useRef(null);
|
|
2892
2892
|
const [playing, setPlaying] = React42.useState(false);
|
|
2893
2893
|
const [time, setTime] = React42.useState(initialTime);
|
|
@@ -2901,7 +2901,7 @@ var VideoPlayer = React42.forwardRef(
|
|
|
2901
2901
|
else el.pause();
|
|
2902
2902
|
};
|
|
2903
2903
|
return /* @__PURE__ */ jsxs33("div", { ref, className: cn("flex w-full flex-col overflow-hidden rounded-lg border border-border bg-surface", className), ...props, children: [
|
|
2904
|
-
/* @__PURE__ */ jsxs33("div", { className: "group/player relative flex
|
|
2904
|
+
/* @__PURE__ */ jsxs33("div", { className: cn("group/player relative flex w-full items-end bg-accent-soft", aspect === "video" ? "aspect-video" : "h-60.5"), children: [
|
|
2905
2905
|
src && /* @__PURE__ */ jsx43(
|
|
2906
2906
|
"video",
|
|
2907
2907
|
{
|
|
@@ -3007,6 +3007,7 @@ var VideoPlayer = React42.forwardRef(
|
|
|
3007
3007
|
name,
|
|
3008
3008
|
details,
|
|
3009
3009
|
onRemove,
|
|
3010
|
+
compact: compactInfo,
|
|
3010
3011
|
actions: moreIn === "info" && /* @__PURE__ */ jsx43(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": "More", onClick: onMore, children: /* @__PURE__ */ jsx43(DotsThreeVertical, { size: 16, "aria-hidden": true }) })
|
|
3011
3012
|
}
|
|
3012
3013
|
),
|