Skip to content

Commit

Permalink
feat(DataTable): ability to select rows and bulk action them
Browse files Browse the repository at this point in the history
SIKKA-7054[closed]
SIKKA-7053[closed]
SIKKA-7017[closed]
  • Loading branch information
zaaakher committed Jun 1, 2024
1 parent 4925632 commit 41efdb5
Show file tree
Hide file tree
Showing 20 changed files with 759 additions and 474 deletions.
7 changes: 7 additions & 0 deletions apps/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hawa-docs

## 0.0.85

### Patch Changes

- Updated dependencies
- @sikka/hawa@0.41.0

## 0.0.84

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawa-docs",
"version": "0.0.84",
"version": "0.0.85",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
Expand Down Expand Up @@ -83,12 +83,12 @@
},
"devDependencies": {
"@types/lodash.template": "^4.5.3",
"@types/node": "^20.12.13",
"@types/node": "^20.13.0",
"@types/react": "^18.3.3",
"@types/react-color": "^3.0.12",
"@types/react-dom": "^18.3.0",
"esbuild": "^0.21.4",
"eslint": "^9.3.0",
"eslint": "^9.4.0",
"mdast-util-toc": "^7.0.1",
"postcss": "^8.4.38",
"rehype": "^13.0.1",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^20.12.13",
"@types/node": "^20.13.0",
"concurrently": "^8.2.2",
"husky": "^9.0.11",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"prettier": "^3.3.0",
"prettier-plugin-tailwindcss": "^0.6.1",
"typescript": "^5.4.5"
}
}
7 changes: 7 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sikka/hawa

## 0.41.0

### Minor Changes

- Add `Behance`, `Linkedin`, `Telegram`, `Youtube`, and `Tiktok` logos to the `Logo` component
- `DataTable`: add ability to select rows and trigger bulk actions on them

## 0.40.0

### Minor Changes
Expand Down
3 changes: 1 addition & 2 deletions packages/components/blocks/feedback/FeedbackForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ export const FeedbackForm: React.FC<FeedbackFormType> = (props) => {
console.log("Form is submitted but onSubmit prop is missing");
}
})}
className="hawa-flex hawa-flex-col hawa-gap-2"
className="hawa-flex hawa-flex-col hawa-gap-4"
>
<Label></Label>
<Controller
name="requestType"
control={control}
Expand Down
29 changes: 14 additions & 15 deletions packages/components/elements/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as React from "react";

import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
import { cn } from "@util/index";

import { RadiusType } from "@_types/commonTypes";

import { cn } from "@util/index";

type CheckBoxTypes = {
id: string;
label?: React.ReactNode;
Expand Down Expand Up @@ -34,13 +33,13 @@ export const Checkbox: React.FC<CheckboxProps> = ({
default: 1,
md: 0.8,
lg: 0.9,
xl: 1
xl: 1,
};
return (
<div
className={cn(
"hawa-flex hawa-gap-2",
size === "default" ? "hawa-items-top" : "hawa-items-center"
size === "default" ? "hawa-items-top" : "hawa-items-center",
)}
>
<CheckboxElement
Expand All @@ -58,13 +57,13 @@ export const Checkbox: React.FC<CheckboxProps> = ({
className={cn(
"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium",
disabled
? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70 "
: "hawa-cursor-pointer"
? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70"
: "hawa-cursor-pointer",
)}
style={{
// lineHeight: labelLineHeightStyles[size]

lineHeight: 1
lineHeight: 1,
}}
>
{label}
Expand All @@ -77,7 +76,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground",
disabled
? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70"
: "hawa-cursor-pointer"
: "hawa-cursor-pointer",
)}
>
{sublabel}
Expand All @@ -88,7 +87,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
htmlFor={id}
className={cn(
"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color",
disabled && "hawa-cursor-not-allowed hawa-opacity-70"
disabled && "hawa-cursor-not-allowed hawa-opacity-70",
)}
>
{helperText}
Expand All @@ -110,38 +109,38 @@ const CheckboxElement = React.forwardRef<
let checkboxRadius = {
none: "hawa-rounded-none",
inherit: "hawa-rounded-sm",
full: "hawa-rounded-full"
full: "hawa-rounded-full",
};
let checkboxSizes = {
xs: "hawa-w-3 hawa-h-3",
sm: "hawa-w-6 hawa-h-6",
default: "hawa-icon",
md: "hawa-w-8 hawa-h-8",
lg: "hawa-w-10 hawa-h-10",
xl: "hawa-w-12 hawa-h-12"
xl: "hawa-w-12 hawa-h-12",
};
let checkboxIndicatorSizes = {
xs: "0.5em",
default: "0.60em",
sm: "0.75em",
md: "0.875em",
lg: "1em",
xl: "1.25em"
xl: "1.25em",
};
return (
<CheckboxPrimitive.Root
ref={ref}
className={cn(
"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
checkboxSizes[size],
checkboxRadius[radius],
className
className,
)}
{...props}
>
<CheckboxPrimitive.Indicator
className={cn(
"hawa-flex hawa-items-center hawa-justify-center hawa-text-current"
"hawa-flex hawa-items-center hawa-justify-center hawa-text-current",
)}
>
<svg
Expand Down
Loading

0 comments on commit 41efdb5

Please sign in to comment.