@asdp/ferryui 0.1.12 → 0.1.13

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/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { makeStyles, tokens, shorthands, Popover, PopoverTrigger, Input, PopoverSurface, Dialog, DialogSurface, DialogBody, DialogTitle, DialogContent, Body1, Button, Carousel, mergeClasses, CarouselViewport, CarouselSlider, CarouselNav, CarouselNavButton, CarouselCard, Subtitle2, Card, Tooltip, Badge, Caption1, Title2, Caption2, Divider, Title3, Caption1Strong, Field, Label, Text, Body1Strong, Checkbox, MessageBar, MessageBarBody, Accordion, AccordionItem, AccordionHeader, AccordionPanel, RadioGroup, Radio, typographyStyles, Switch, Textarea } from '@fluentui/react-components';
2
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
3
  import React2, { forwardRef, useState, useCallback, useRef, useEffect, useMemo } from 'react';
4
+ import { Row, Col } from 'react-grid-system';
4
5
  import { Icon } from '@iconify/react';
5
6
  import { Controller } from 'react-hook-form';
6
7
  import PhoneInputComponent from 'react-phone-input-2';
@@ -296,7 +297,6 @@ var useStyles3 = makeStyles({
296
297
  info: {
297
298
  display: "flex",
298
299
  flexDirection: "column",
299
- padding: tokens.spacingHorizontalM,
300
300
  width: "100%",
301
301
  alignContent: "center",
302
302
  justifyContent: "space-between",
@@ -313,6 +313,22 @@ var useStyles3 = makeStyles({
313
313
  padding: tokens.spacingVerticalSNudge,
314
314
  gap: tokens.spacingVerticalXS
315
315
  }
316
+ },
317
+ infoWrapper: {
318
+ padding: tokens.spacingHorizontalM
319
+ },
320
+ buttonWrapper: {
321
+ display: "flex",
322
+ justifyContent: "center",
323
+ alignItems: "center"
324
+ },
325
+ title: {
326
+ lineClamp: 2,
327
+ overflow: "hidden",
328
+ textOverflow: "ellipsis",
329
+ display: "-webkit-box",
330
+ WebkitLineClamp: 2,
331
+ WebkitBoxOrient: "vertical"
316
332
  }
317
333
  });
318
334
  var CardPromo = ({
@@ -322,7 +338,10 @@ var CardPromo = ({
322
338
  imageAlt = "Promo image",
323
339
  index = 0,
324
340
  totalCards,
325
- onClick
341
+ onClick,
342
+ showButton = false,
343
+ buttonText = "Lihat Detail",
344
+ className
326
345
  }) => {
327
346
  const classes = useStyles3();
328
347
  const ariaLabel = totalCards ? `Card ${index + 1} of ${totalCards}` : `Promo card ${index + 1}`;
@@ -330,7 +349,7 @@ var CardPromo = ({
330
349
  CarouselCard,
331
350
  {
332
351
  autoSize: true,
333
- className: classes.actionCard,
352
+ className: mergeClasses(classes.actionCard, className),
334
353
  "aria-label": ariaLabel,
335
354
  onClick,
336
355
  style: { cursor: onClick ? "pointer" : "default" },
@@ -344,9 +363,22 @@ var CardPromo = ({
344
363
  alt: imageAlt
345
364
  }
346
365
  ) }),
347
- /* @__PURE__ */ jsxs("div", { className: classes.info, children: [
348
- /* @__PURE__ */ jsx(Subtitle2, { children: title }),
349
- /* @__PURE__ */ jsx(Body1, { children: description })
366
+ /* @__PURE__ */ jsxs(Row, { className: classes.infoWrapper, children: [
367
+ /* @__PURE__ */ jsxs(Col, { className: classes.info, xs: 12, sm: 12, md: 12, lg: showButton ? 8 : 12, xl: showButton ? 8 : 12, xxl: showButton ? 8 : 12, xxxl: showButton ? 8 : 12, children: [
368
+ /* @__PURE__ */ jsx(Subtitle2, { className: classes.title, children: title }),
369
+ /* @__PURE__ */ jsx(Body1, { className: classes.title, children: description })
370
+ ] }),
371
+ showButton && /* @__PURE__ */ jsx(Col, { className: classes.buttonWrapper, xs: 12, sm: 12, md: 12, lg: showButton ? 4 : 0, xl: showButton ? 4 : 0, xxl: showButton ? 4 : 0, xxxl: showButton ? 4 : 0, children: /* @__PURE__ */ jsx(
372
+ Button,
373
+ {
374
+ appearance: "primary",
375
+ size: "small",
376
+ onClick,
377
+ style: { cursor: onClick ? "pointer" : "default" },
378
+ shape: "circular",
379
+ children: buttonText
380
+ }
381
+ ) })
350
382
  ] })
351
383
  ]
352
384
  }
@@ -2167,8 +2199,21 @@ function InputDynamic({
2167
2199
  onChange: (_, data) => field.onChange(data.checked)
2168
2200
  }
2169
2201
  ) });
2170
- case "date":
2171
- return /* @__PURE__ */ jsx(DatePickerInput_default, { ...commonProps, field });
2202
+ case "date": {
2203
+ return /* @__PURE__ */ jsx(
2204
+ DatePickerInput_default,
2205
+ {
2206
+ field,
2207
+ placeholder,
2208
+ disabled,
2209
+ appearance: error ? "outline" : appearance,
2210
+ size,
2211
+ onClick,
2212
+ style: inputStyle,
2213
+ max: max ? String(max) : void 0
2214
+ }
2215
+ );
2216
+ }
2172
2217
  case "radio":
2173
2218
  return /* @__PURE__ */ jsx(RadioGroup, { ...field, disabled, layout: layout ?? "vertical", children: options.map((option) => /* @__PURE__ */ jsx(
2174
2219
  Radio,